Predict the output of the below code : String emailId="john#global.com"; System.out.println(emailId.indexOf('@'));
Answer options
A
indexOf('@'));
B
Any negative integer
C
-1
D
0
E
1
Correct answer: -1
Explanation
Correct answer: -1.
Correct answer: -1
Correct answer: -1.
PrimerDumps has 1400+ primer questions, 2026 mocks and coding hands-on — all free.