Ask Question

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

+5
Answers (1)
  1. 16 September, 16:54
    0
    R. indexOf ('t') is 1

    q. charAt (1) is d.

    It will output 5. d
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is output by the following code? String q = "adjective"; String r = "stinky"; System. out. println (q. charAt (r. indexOf ('t'))); 1. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers