• Post Reply Bookmark Topic Watch Topic
  • New Topic

compile error in hello java program  RSS feed

 
Raj Gurung
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
i wrote this program:
class hellojava
{
public static void main(string[] args)
{
system.out.println("hello java");
}
}


Then i saved this file with name hellojava.java(notepad) in C drive in separate folder c:\myjavaapp(not in c:\java folder).
when i am compiling(with javac hellojava.java) it shows following error:
cannot find symbol public static void main(string[] args), and also says package system doesnot exists system.out.println("hello java");

does anyone knows the problem???
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj Gurung wrote:
cannot find symbol public static void main(string[] args), and also says package system doesnot exists system.out.println("hello java");

does anyone knows the problem???


Java is case sensitive, so "system" and "System" are different. And BTW, "string" and "String" are also different.

Henry
 
Raj Gurung
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot it worked.

one more thing:
System is case sensitive.
is String also case sensitive???

thanks
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj Gurung wrote:
one more thing:
System is case sensitive.
is String also case sensitive???


Java is case sensitive -- so you have to be exact with class names, method names, variable names, etc. etc. etc.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!