Advertisements
Advertisements
प्रश्न
Identify the incorrect statement.
विकल्प
long g = 65.8;int t = 72;byte b = 3;double h = 92;
MCQ
Advertisements
उत्तर
long g = 65.8;
Explanation:
Tries to assign a decimal value (which Java treats as a float) to a long integer variable. Because a long can only store whole numbers, this causes a compile-time type mismatch error due to a loss of precision.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Class as the Basis of all Computation - Exercises [पृष्ठ ६४]
