Sunday, February 22, 2009

sample code to show float,double literals



/* sample code to show float,double literals */
package literals;

public class FloatLiteral {


public static void main(String[] args) {
// not valid Declarations

// float f=123.456;
// float f=123.56d;

// valid Declarations
double d=123.456;
double d1=123.453f;
float f=123;
float f1= 0123;
float f2=0x123;

}

}


0 comments:

Post a Comment