मराठी

Given: int KH[] = {0, 0, 0, 0, 0, 0} int len = KH.length; system.out.print("array length="+len); The output will be ______.

Advertisements
Advertisements

प्रश्न

Given:

int KH[] = {0, 0, 0, 0, 0, 0}
int len = KH.length;
system.out.print("array length="+len);

The output will be ______.

पर्याय

  • array length = 6

  • array length = 0

  • array length = 7

  • array length = 5

MCQ
रिकाम्या जागा भरा
Advertisements

उत्तर

The output will be array length = 6.

Explanation:

  • Counting Elements: The array variable KH explicitly contains six zero values enclosed within its curly brackets.
  • Length Property: The built-in .length property in Java accurately counts the total number of allocated storage slots inside an array regardless of the values stored in them.
  • Final Print: The program prints out the text literal exactly as specified, displaying array length=6 on the console screens.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Arrays - One Dimension - Exercises [पृष्ठ १७३]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 7 Arrays - One Dimension
Exercises | Q 1. (vii) | पृष्ठ १७३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×