File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "variable declarations" Watch "variable declarations" New topic

variable declarations

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

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.

Visit my download page
Darryl Burke

Joined: May 03, 2008
Posts: 5093

That applies to class and instance fields. Not to local variables.


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