Single Choice
Moderate
Q
Give the output of the following code :
String A = "56.0", B = "94.0"; double C = Double.parseDouble(A); double D = Double.parseDouble(B); System.out.println((C+D));
ID: #23971
ICSE Computer Application - Class X - 2022 PYQ
69 views
Question Info
#23971Q ID
ModerateDifficulty
ICSE Computer Application - Class X - 2022 PYQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
150.0
Reason — parseDouble() method returns a double value represented by the specified string. Thus, double values 56.0 and 94.0 are stored in C and D, respectively. Both C and D are added and 150.0 (56.0 + 94.0) is printed on the screen.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic