Home / Programming MCQs / JAVA MCQs / Question
K
Q. What is the output of the following code snippet?
String s1 = “Hello”; String s2 = sA)replace(‘l’, ‘z’); System.out.println(s2);
Explanation:
The replace method in Java returns a new string that is the original string with all occurrences of a specified character replaced by another character. In this case, sA)replace(‘l’, ‘z’) returns “Hezzo”.
You must be Logged in to update hint/solution
Iterator returned by ArrayList is?
What is the output of the Java program?
The client requests a connection to a server using which of the following statement?
Which of these packages contains the exception Stack Overflow in Java?
What is the range of data type byte in Java?
Discusssion
Login to discuss.