How many objects will be created?
String a = new String("Examveda");
String b = new String("Examveda");
String c = "Examveda";
String d = "Examveda";
How many objects will be created?
String a = new String("Examveda");
String b = new String("Examveda");
String c = "Examveda";
String d = "Examveda";
What will be the output of the following program?
public class Test{
public static void main(String args[]){
String str1 = "one";
String str2 = "two";
System.out.println(str1.concat(str2));
}
}
What will be the output of the following program?
public class Test{
public static void main(String args[]){
String str1 = "one";
String str2 = "two";
System.out.println(str1.concat(str2));
}
}
What is the output of the following println statement?
String str1 = "Hellow";
System.out.println(str1.indexOf('t'));
What is the output of the following println statement?
String str1 = "Hellow";
System.out.println(str1.indexOf('t'));
How many Constructor String class have?
How many Constructor String class have?
String str1 = "Kolkata".replace('k', 'a');
In the above statement, the effect on string Kolkata is
String str1 = "Kolkata".replace('k', 'a');
In the above statement, the effect on string Kolkata is
toString() method is defined in
toString() method is defined in
The String method compareTo() returns
The String method compareTo() returns
What could be output of the following fragment of code?
public class Test{
public static void main(String args[]){
String x = "hellow";
int y = 9;
System.out.println(x += y);
}
}
What could be output of the following fragment of code?
public class Test{
public static void main(String args[]){
String x = "hellow";
int y = 9;
System.out.println(x += y);
}
}
What will be the output?
public class Test{
public static void main (String[] args){
String test = "a1b2c3";
String[] tokens = test.split("\\d");
for(String s: tokens)
System.out.print(s);
}
}
What will be the output?
public class Test{
public static void main (String[] args){
String test = "a1b2c3";
String[] tokens = test.split("\\d");
for(String s: tokens)
System.out.print(s);
}
}
The output of the following fraction of code is
public class Test{
public static void main(String args[]){
String s1 = new String("Hello");
String s2 = new String("Hellow");
System.out.println(s1 = s2);
}
}
The output of the following fraction of code is
public class Test{
public static void main(String args[]){
String s1 = new String("Hello");
String s2 = new String("Hellow");
System.out.println(s1 = s2);
}
}
Determine output:
public class Test{
public static void main(String args[]){
String str = null;
if(str.length() == 0){
System.out.print("1");
}
else if(str == null){
System.out.print("2");
}
else{
System.out.print("3");
}
}
}
Determine output:
public class Test{
public static void main(String args[]){
String str = null;
if(str.length() == 0){
System.out.print("1");
}
else if(str == null){
System.out.print("2");
}
else{
System.out.print("3");
}
}
}
The class string belongs to ................. package.
The class string belongs to ................. package.
What will be the output?
String str1 = "abcde";
System.out.println(str1.substring(1, 3));
What will be the output?
String str1 = "abcde";
System.out.println(str1.substring(1, 3));
What will be the output of the following program code?
class LogicalCompare{
public static void main(String args[]){
String str1 = new String("OKAY");
String str2 = new String(str1);
System.out.println(str1 == str2);
}
}
What will be the output of the following program code?
class LogicalCompare{
public static void main(String args[]){
String str1 = new String("OKAY");
String str2 = new String(str1);
System.out.println(str1 == str2);
}
}
What will be the output of the following program code?
public class Test{
public static void main(String args[]){
String s = "what";
StringBuffer sb = new StringBuffer("what");
System.out.print(sb.equals(s)+","+s.equals(sb));
}
}
What will be the output of the following program code?
public class Test{
public static void main(String args[]){
String s = "what";
StringBuffer sb = new StringBuffer("what");
System.out.print(sb.equals(s)+","+s.equals(sb));
}
}
What will be the output?
1. public class Test{
2. public static void main(String args[]){
3. Object myObj = new String[]{"one", "two", "three"};
4. {
5. for(String s : (String[])myObj)
6. System.out.print(s + ".");
7. }
8. }
9. }
What will be the output?
1. public class Test{
2. public static void main(String args[]){
3. Object myObj = new String[]{"one", "two", "three"};
4. {
5. for(String s : (String[])myObj)
6. System.out.print(s + ".");
7. }
8. }
9. }
Determine output:
public class Test{
public static void main(String args[]){
String s1 = "SITHA";
String s2 = "RAMA";
System.out.println(s1.charAt(0) > s2.charAt(0));
}
}
Determine output:
public class Test{
public static void main(String args[]){
String s1 = "SITHA";
String s2 = "RAMA";
System.out.println(s1.charAt(0) > s2.charAt(0));
}
}
What will be output?
String S1 = "S1 ="+ "123"+"456";
String S2 = "S2 ="+(123+456);
What will be output?
String S1 = "S1 ="+ "123"+"456";
String S2 = "S2 ="+(123+456);
What will be the output of the following program?
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);
}
}
What will be the output of the following program?
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);
}
}