sleep() methods of a Thread class is used to suspend a thread for a period of time
Predict the output of the following Java code.
What type of variable can be defined in an interface?
What will be the value of “d” after this line of code has been executed?
double d = Math.round ( 3.5 + Math.random() );
String s1= new String("Abekus");
String s2= new String("Abekus");
String s3 = "Abekus";
String s4 = "Abekus";
What is the output of the following Java code?
class Abekusain {
public static void main(String args[]) {
System.out.println(fellow());
}
int fellow()
{
return 45;
}
}
What is the output of the following Java code?
class Abekus {
public static void main(String args[])
{
String str = "Abekus";
char ch = str.charAt(4);
System.out.println(ch);
}
}
public class outputs
{
public static void main(String args[])
{
int a=10;
int b=20;
int c=30;
int sum=0;
sum= sum + ++a/++b/++c;
System.out.println(sum);
}
}
public class test
{
public static void main(String[] args)
{
int[][][] x={{{10,20,30},{40,50,60}},{{70,80},{90,100,110}}};
System.out.println(x[0][1][2]);
}
}
Predict the output of the following Java code.
import java.util.*;
public class Abekus {
public static void main(String[] args) {
TreeSet<Integer> ts = new TreeSet<>();
ts.add(987);
ts.add(450);
ts.add(873);
ts.add(123);
ts.add(245);
for (Integer i : ts)
System.out.printf(i + " ");
}
}