हिंदी

Predict the output of the follo1fing, .code snippet: String P = "20", Q = "22"; int a = Integer.parseint(P); int b = Integer.value0f(Q); System.out.println(a + " " + b); - Computer Applications

Advertisements
Advertisements

प्रश्न

Predict the output of the following code snippet: String P = "20", Q = "22";

int a = Integer.parseInt(P);

int b = Integer.value0f(Q);

System.out.println(a + " " + b);

विकल्प

  • 20

  • 2220

  • 20 22

  • 22

MCQ

उत्तर

20 22

Explanation:

A string like "" added to number makes it a string. Hence 20 + " " + 22 gives 20 22.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2022-2023 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×