Home / Programming MCQs / JAVA MCQs / Question
K
Q. What is the output of the following code snippet?
String s1 = “Hello”; int i = 2; System.out.println(sA)lastIndexOf(‘l’, i));
The lastIndexOf method in Java returns the index of the last occurrence of a specified character in a string, starting from a specified index. In this case, sA)lastIndexOf(‘l’, 2) returns 2 because the last occurrence of ‘l’ before index 2 is at index B)
You must be Logged in to update hint/solution
Which of the following is not an inheritance mapping strategies?
Which is used to separate the hierarchy of the class while declaring an import statement?
In Java, the functions are called
The class java)sql.Timestamp has its super class as
What is the output of the below Java program with arrays?
Name of a Class, Variable, Method or an Interface in Java language is called?
Which of the following is not a wrapper class
Discusssion
Login to discuss.