• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error in Hello World Program  RSS feed

 
Anshul Kulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • 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.
 
John Joe
Ranch Hand
Posts: 430
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the = sign

 
Mani pradeepmari
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks a lot guys for the quick response. It really helped me out.
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!