Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
valid and invalid declarations
Joined: Apr 26, 2007
May 02, 2007 05:28:00
Which of the following are not a valid declarations?
A1 float f = 1;
A2 float f = 1.2f;
A3 float f = 1.2;
A4 float f = (float)1.2;
In this case float f =1 is a valid declaration. Can any one help me why this declaraion is a valid declaration.
Joined: Mar 27, 2004
May 02, 2007 05:41:00
This is a Widening Primitive Conversion.
types can be implicitly converted to
. Please, check the following articles:
[ May 02, 2007: Message edited by: Leandro Melo ]
SCJP 1.4, SCWCD 1.4
subject: valid and invalid declarations
Which are the valid declarations of Float?
"valid declarations of a float" required
About the data type
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013