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.
State the data type and value of res after the following is executed :
char ch = ‘9’;
res = Character. isDigit(ch)
Write a difference between the functions isUpperCase() and toUpperCase().
What will be the output when the following code segment is executed?
System.out.println(“The king said\”Begin at the beginning!\“to me.”);
Write the value of n after execution:
char ch = 'd';
int n = ch + 5;What is the method to check whether a character is a letter or digit?
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);
A student is trying to convert the string present in x to a numerical value, so that he can find the square root of the converted value, However the code has an error. Name the error (syntax/logical/runtime). Correct the code so that it compiles and runs correctly.
String x="25";
int y=Double.parseDouble(x);
double r=Math.sqrt(y);
System.out.println(r);