Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> Java Beginner

Pages: 1
mohanjava5
stranger


Reged: 08/03/08
Posts: 1
JAVA BEGINNER
      #177547 - 08/03/08 03:05 AM

I''m very much new to java,learning fundamentals of it. pls. clarify my doubt.
THE FOLLOWING CODE COMPILES PERFECTLY: Code:
  


---------------------------------------------
class abc
{
double a
{
System.out.println("hello")
}
}
---------------------------------------------
BUT THE SAME FOLLOWING CODE GIVES COMPILATION ERROR:
---------------------------------------------
class abc
{
double a
System.out.println("Hello")
}
---------------------------------------------


Post Extras: Print Post   Remind Me!   Notify Moderator  
hiwa
Carpal Tunnel


Reged: 06/21/03
Posts: 7704
Loc: Japan
Re: JAVA BEGINNER [Re: mohanjava5]
      #177697 - 08/03/08 05:30 PM

Read and try this before writing anything.
http://java.sun.com/docs/books/tutorial/getStarted/index.html

--------------------
*stop cruelty* Annual number of euthanized cats&dogs: US 5M, JP 500K.*for our better karma*


Post Extras: Print Post   Remind Me!   Notify Moderator  
Jeroen
veteran


Reged: 07/07/03
Posts: 1490
Loc: The Netherlands
Re: JAVA BEGINNER [Re: mohanjava5]
      #177811 - 08/04/08 11:33 AM

And one more advice: read the error message of the compiler carefully. It might be cryptic at first, but it informs you what the error was that prevented a successful compilation. When posting questions here concerning a compilation error, pleas incorporate the error message.

--------------------
With the light in our eyes, it's hard to see.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 5984

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5