• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array of foats default values  RSS feed

 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Kathy Sierra wrote in the great book "Java 2 Sun Certified Programmer & Developer" (page 50) that the default value for the elements of an array of floats is 0.0f Though, the following code doesn't explicit the "f" after 0.0

float[] floatArray = new float[7];
System.out.println(floatArray[2]);

Am I being way too picky? Or is the book wrong?

Any thoughts are much appreciated.
 
Animesh Shrivastava
Ranch Hand
Posts: 298
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Animesh!
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just passed the SCJP1.4 exam and wanted to post this appreciation note to thank everyone who helped me understand Java a little better. Without your help this personal achievement wouldn't be possible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!