• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error in Hello World Program

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys. I am new here and have just started programming. I was writing my Hello World Program in BlueJ when I encountered a compile time error. When I compile my code, It shows [ cannot find symbol-variable println ].
I have included the code and a screenshot  of the code. Please help me out as soon as possible.

Regards,
Anshul Kulkarni.



HelloWorld-Compile-time-error.png
[Thumbnail for HelloWorld-Compile-time-error.png]
Screen Shot of the error
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Remove the = to change the code to be a call to the println() method instead of an assignment statement.

Note: Spaces were added to make it easier to see.
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remove the = sign

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anshul Kulkarni wrote:Hi guys. I am new here and have just started programming. I was writing my Hello World Program in BlueJ when I encountered a compile time error. When I compile my code, It shows [ cannot find symbol-variable println ].
I have included the code and a screenshot  of the code. Please help me out as soon as possible.

Regards,
Anshul Kulkarni.






Kindly correct the code as mentioned below

public static void main(String args[])
{

   {
       String str1="Hello";
       
       System.out.println(str1+ " world");
   }
}
 
Anshul Kulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot guys for the quick response. It really helped me out.
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Anshul and Mani!

Anshul: Thank you for using code tags on your first post!  One thing: the preferred way to post errors is to copy and paste the text, not with a screenshot.

Mani, thank you for your contribution.  A couple of things to keep in mind.  Please UseCodeTags (that's a link) when you are posting code.  Also, in general, we don't post complete solutions to the OP's questions.  Here I don't think it's a problem but next time try to guide the OP to the correct solution.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic