File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 4340
    
    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: 4523
    
    5

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
 
Similar Threads
how to reset the field after validation using annotations(Struts 2)
Doubt in EL Implicit Objects: Cookie
jsp bean problem
How to convert the for Loop to the equalent JSTL code in JSP
Tricky Question