Computer Applications
Java statement to access the 5th element of an array is:
- X[4]
- X[5]
- X[3]
- X[0]
Java Arrays
ICSE Sp 2024
29 Likes
Answer
X[4]
Reason — Array indexes start from 0. So, X[4] refers to the 5th element of the array.
Answered By
15 Likes
Related Questions
The output of Math.round(6.6) + Math.ceil(3.4) is:
- 9.0
- 11.0
- 10.0
- 11
Name the type of error, if any in the following statement:
System.out.print("HELLO")- logical
- no error
- runtime
- syntax
The output of "Remarkable".substring(6) is:
- mark
- emark
- marka
- able
Which of the following is the wrapper class for the data type char?
- String
- Char
- Character
- Float