• Post Reply Bookmark Topic Watch Topic
  • New Topic

Explain-Methods and Instance Variables  RSS feed

 
Arin Khatua
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explain me what is a method and instance variables?
 
Daniel Hirning
Ranch Hand
Posts: 50
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arin,

Welcome to the ranch!

I would suggest reading the Java tutorials, and thoroughly browsing this site, most answers are readily available for questions at this level.

To hopefully answer the question, which will probably lead you to more questions.

An instance variable is something an object knows about itself and a method is something an object can do.

If the object was an Orange for example it could know and do the following.

myColor-instance variable
getEaten-method

Hope this helps?
 
Arin Khatua
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You for your tip.
 
Campbell Ritchie
Marshal
Posts: 56595
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!