This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

Declaration and Access Control

 
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: 9510
22
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: 42967
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.
 
    Bookmark Topic Watch Topic
  • New Topic