Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

variable declarations  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4583
6
Java Python 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!