This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes variable declarations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "variable declarations" Watch "variable declarations" New topic
Author

variable declarations

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351
    
    2

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.


SCJP
Visit my download page
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 5003
    
    8

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

luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: variable declarations
 
It's not a secret anymore!