मराठी

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×