MCQ Single Best Answer Moderate

QGive the output of the following code:

String[] words = {"Java", "is", "fun"};
System.out.println(words[0].length() + words[2].length());

ID: #23888 ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL 67 views
Question Info
#23888Q ID
ModerateDifficulty
ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOLTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 8
  • B 6
  • C 5
  • D 7
Correct Answer: Option D

Explanation

Explanation:

 

words[0] = "Java" → words[0].length() = 4.

words[2] = "fun" → words[2].length() = 3.

Total: 

4

+

3

=

 

7

4+3=7.

Share This Question

Challenge a friend or share with your study group.