aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About default values in array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About default values in array" Watch "About default values in array" New topic
Author

About default values in array

Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
Look at the code below:
float ff[] = new float[2];
System.out.println("The value of float is " + ff[0]);
System.out.println("The value of float is " + ff[1]);

It displays the output as:
The value of float is 0.0
The value of float is 0.0

Well, i was wondering whether 0.0f should be displayed rather than 0.0??
Lakshmi Keshav
Greenhorn

Joined: Jan 17, 2005
Posts: 7
0.0f is for assigning literals to float variables. Display does not show any appended f.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About default values in array