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
Quick AnswerThe correct answer is -1 because it directly addresses the core logic of Java Programming.
Correct answer: -1.