मराठी

Which of the following is implicit typecasting?

Advertisements
Advertisements

प्रश्न

Which of the following is implicit typecasting?

पर्याय

  • int p = (int) 49.8 + 26;

  • long m = (int) 49.8*2;

  • double d = 49.8 + 56;

  • double b = 38/10;

MCQ
Advertisements

उत्तर

double d = 49.8 + 56;

Explanation:

In this statement, you are adding a decimal double (49.8) to a whole number int (56). Java automatically converts the smaller integer type into a double type (56.0) during runtime so it can perform the math smoothly without any manual syntax or data loss.

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. (vii) | पृष्ठ ६४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×