What is output by the following code?

String q = "adjective";
String r = "stinky";

System.out.println( q.charAt( r.indexOf ('t')));
1. 1
2. 2
3. Index out of bounds exception
4. a
5. d

Respuesta :

r.indexOf('t') is 1
q.charAt(1) is d.

It will output 5. d
ACCESS MORE
EDU ACCESS