Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

interview question  RSS feed

 
rabindra barik
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me the difference when i am writting class.staticvariable and
Object.staticvariable.where staticvariable is astatic member of class,Object is object of class.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No difference.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This forum is for posting your availability, or that you are looking for work. since this is a question about Java, i'm going to move it to Java in General - Beginners.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While both forms of syntax do the same thing, most ranchers prefer Class.member over object.member because it's more honestly self-documenting. Eclipse even issues a warning when you do object.member and offers to change it to Class.member.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!