Statement
try{
}
finally{
}
Predict the output of the following Java program.
What does JMX stand for?
What does ORM (Object-Relational Mapping) simplify?
Which of these methods of the Java String class is used to extract a single character from a String object?
public class Demo123{
public static void main(String args[]){
String s1= new String("hello");
String s2= new String("Abekus");
System.out.println(s1=s2);
}
}
What is an inner class in Java?
Find the output of the following Java code:
public class Abekus {
public static void main(String[] args) {
for (int i = 1; i < 2; fun())
System.out.println("Abekus");
}
public static void fun() {
System.out.println(2);
}
}
Predict the output of the following Java code:
class Abekus {
public static void main(String args[])
{
String s[] = { "ab", "de", "ef", "ab", "ef" };
for (int i = 0; i < s.length; ++i)
for (int j = i + 1; j < s.length; ++j)
if (s[i].compareTo(s[j]) == 0)
System.out.print(s[j]);
}
}
Predict the output of the following Java code.
class AbekusParent {
public static String s = "abcd";
public AbekusParent() {
System.out.print("efgh");
}
}
public class AbekusChild extends AbekusParent {
public AbekusChild() {
System.out.print("ijkl");
super();
}
public static void main(String[] args) {
AbekusChild o = new AbekusChild();
System.out.print(s);
}
}