₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,398 members, 8,445,316 topics. Date: Tuesday, 14 July 2026 at 08:01 PM

Toggle theme

Help With Java Hello World - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp With Java Hello World (815 Views)

1 Reply (Go Down)

Help With Java Hello World by Laryokeke(op): 4:33pm On Jan 10, 2014
I am not entirely new to programming, as i have a background in Basic and Javascript. however for the past 3 months, i have been learning Java thoroughly to add to my itinery but can't seem to get past the universal Hello World program.

I am using J Creator and have installed the sdk, as well as java jvm.

Now when i put the following code

class MyFirstJavaClass {
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) {
System.out.println(“Chocolate, royalties, sleep”);
}
}


i get ten errors, ranging from "Illegal Expression to "MyHelloWorldClass" not found.

I have researched so thoroughly to resolve this that i have become quite familiar with the syntax of Java...and yet can't make a hello world program.

Can any Javanian help me out of this embarrassing situation? or if J creator is the problem (Like i have begun to suspect), can i be pointed to any other IDE that will not have problems with classes- anything that will spare me the agony of ....any class errors whatsoever!
Re: Help With Java Hello World by Nobody: 6:21pm On Jan 10, 2014
your args should come before the square brackets
Re: Help With Java Hello World by Danyl(m): 7:28pm On Jan 10, 2014
rutchiekens: your args should come before the square brackets
that wouldnt solve the problem. Append "public" to ur main class declaration, den add ur default constructor-public MyFirstJavaClass(){

} before ur main method
2. frm ur experience it shows u saved ur source file as MyHelloWorldClass.java instead of MyFirstJavaClass.java
2b. u shud also split d string literal u supplied as argument to the println method as System.out.println("Chocolate"+" "+","+"Royalties"+" "+" "+"Sleep"wink;
3. rename ur java source file as MyFirstJavaClass.java
Re: Help With Java Hello World by Nobody: 7:48pm On Jan 10, 2014
"MyFirstJavaClass" Is NOT Equal To "MyHelloWorldClass"

Save ur SOURCE Code With your CLASS Name.

Do the correction there .
1 Reply

Learning To Program With Java by the FulamanThe Beauty & Power Of JavaScript: "Hello World" Code As A Case StudyDeveloping A Professional Bluetooth Instant Chat Messenger With Java234

9 Great Ideas For Android ApplicationsNigeria's Bride Pice App Maker Interviewed ON CNBCLearn Web Design & Programming?java/php/web Design/c#/json/ajax