Select an option to see the answer and solution.
Strings
practice.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
107
Questions
2/6
Page
Pick an option on a question to see the right answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
public class Test{
public static void main(String args[]){
String s1 = new String("Hello");
String s2 = new String("Hellow");
System.out.println(s1 = s2);
}
}Select an option to see the answer and solution.
class LogicalCompare{
public static void main(String args[]){
String str1 = new String("OKAY");
String str2 = new String(str1);
System.out.println(str1 == str2);
}
}Select an option to see the answer and solution.
public class Test{
public static void main(String args[]){
String s1 = "java";
String s2 = "java";
System.out.println(s1.equals(s2));
System.out.println(s1 == s2);
}
}Select an option to see the answer and solution.
public class Test{
public static void main(String args[]){
String s1 = "SITHA";
String s2 = "RAMA";
System.out.println(s1.charAt(0) > s2.charAt(0));
}
}Select an option to see the answer and solution.
public class Test{
public static void main(String args[]){
String x = "hellow";
int y = 9;
System.out.println(x += y);
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
String str1 = "abcde";
System.out.println(str1.substring(1, 3));Select an option to see the answer and solution.
String str1 = "Hellow";
System.out.println(str1.indexOf('t'));Select an option to see the answer and solution.
public class Test{
public static void main(String args[]){
String str1 = "one";
String str2 = "two";
System.out.println(str1.concat(str2));
}
}Select an option to see the answer and solution.