Advertisements
Advertisements
प्रश्न
State one difference between the floating point literals float and double.
State one difference between the floating point literal and double type literal.
Advertisements
उत्तर १
| float literals | double literals |
| The float literals has a limited range to store decimal data items. | The double literals has a wider range as compared to float to store decimal data items. |
उत्तर २
Floating point literal is a fractional number with short precision and the values can range from -3.4E+38 to 3.4E+38, whereas double type literal is used for long precision and the values can range from -l.7E+308 to l.7E+308.
APPEARS IN
संबंधित प्रश्न
Write the memory capacity (storage size) of short and float data type in bytes.
Differentiate between if else if and switch-case statements.
Give the output of the following code:
String P = “20”, Q = “19”,
int a = Integer .parselnt(P);
int b = Integer. valueOf(Q);
System.out.println(a+””+b);
State the data type and value of res after the following is executed:
char ch = ‘t’;
res=Character. toUpperCase(ch);
Write the return data type of the following function:
log( )
What will be the output when the following code segment is executed?
String s = “1001”;
int x = Integer. valueOf(s);
double y = Double.valueOf(s);
System.out.println(“x=”+x);
System.out.println(“y=”+y);
Give the output of the following Character class method:
Character.isLetterOrDigit('W')Write the value of n after execution:
char ch = 'd';
int n = ch + 5;The method to convert a lowercase character to uppercase is ______.
Predict the output of the following code snippet:
char ch='B';
char chr=Character.toLowerCase(ch);
int n=(int)chr-10;
System.out.println((char)n+"\t"+chr);
