हिंदी

What is the output of the Java code given below? String color [ J = {"Blue", "Red", "Violet"}; System.out.println(color[2].length(); - Computer Applications

Advertisements
Advertisements

प्रश्न

What is the output of the Java code given below?

String color [ J = {"Blue", "Red", "Violet"}; System.out.println(color[2].length();

विकल्प

  • 6

  • 5

  • 3

  • 2

MCQ

उत्तर

6

Explanation:

The array element at index position 2 i.e. color[2] is "Violet" and the number of characters in "Violet" is 6.

shaalaa.com
Output Statement in Java Programming
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2023-2024 (February) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×