Computer Science, asked by akshatsingh6t9, 4 months ago

The index of second element of an

array of p elements is :

Answers

Answered by abhinabchoudhury29
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