Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

variable declarations

 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i just want to confirm what i read today. assigning an int a value of 0, or an object a value of null when you declare it is redundant.
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That applies to class and instance fields. Not to local variables.

edit http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#96595
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic