Bookmark Topic Watch Topic
  • New Topic

Declaration and Access Control  RSS feed

 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator

Hi friends...
I am having a problem in understanding why this code is giving error. Please help...
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Your code is missing curly brackets for the main method...
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
oops...i did it by mistake :O
but if i am putting curly brackets, then also its giving an error. Let me post the modified code in new thread.
thanks
 
Aniket S. Kulkarni
Ranch Hand
Posts: 87
Android Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ankit Garg is right and in println you are calling method without creating the object of Hobbit class.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
continued here

Next time, you can just continue the discussion in the same topic, as it is about the same subject.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!