The index of second element of an
array of p elements is :
Answers
Answered by
1
Answer:
The index of the second elements in the array is 1.
as it starts from 0 .
Ex.
package mypackage;
public class pp {
public static void main(String[] args) {
String s="Abhinab";
System.out.println(s.charAt(0));
System.out.println(s.charAt(1));
System.out.println(s.charAt(2));
System.out.println(s.charAt(3));
System.out.println(s.charAt(4));
System.out.println(s.charAt(5));
System.out.println(s.charAt(6));
}
}
Output:-
A
b
h
i
n
a
b
From this we can conclude that the second element in the string has an index 1.
please give my answer the Brainlyiest answer.
Similar questions
Math,
2 months ago
India Languages,
2 months ago
English,
2 months ago
English,
4 months ago
Accountancy,
4 months ago
India Languages,
10 months ago