• Post Reply Bookmark Topic Watch Topic
  • New Topic

variable declarations  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • 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: 5167
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
Boost this thread!