मराठी

Identify the incorrect statement. (a) long g = 65.8; (b) int t = 72; (c) byte b = 3; (d) double h = 92;

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 [पृष्ठ ६४]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 2 Class as the Basis of all Computation
Exercises | Q 1. (vi) | पृष्ठ ६४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×