What does an annotation type definition look similar to?
Predict the output of the following Java code.
What will be the output of the following Java program that demonstrates object serialization and deserialization?
What will be the output of the following Java code?
class Output
{
public static void main(String args[])
{
String c = "Hello i love java";
boolean var;
var = c.startsWith("hello");
System.out.println(var);
}
}
What will be the output of the following Java code?
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
String s1 = "Abekus";
String s2 = "Abekus";
System.out.println(s1 == s2);
}
}
What will be the output of the following Java program?
class exception_handling
{
public static void main(String args[])
{
try
{
int a, b;
b = 0;
a = 5 / b;
System.out.print("A");
}
catch(ArithmeticException e)
{
System.out.print("B");
}
}
}
Given the following code:
class X implements Runnable
{
public static void main(String args[])
{
/* Missing code? */
}
public void run() {}
}
Which of the following lines of code is suitable to start a thread?
Predict the output of the following Java code.
class Abekus
{
public static void main(String[] args)
{
try
{
System.out.println(5/0);
}
catch(ArithmeticException e)
{
System.out.println(e.getMessage());
}
}
}
class exception_handling
{
public static void main(String args[])
{
try
{
int i = args.length;
int j = 10 / i;
System.out.print(i);
try
{
if (i == 1)
i = i / i - i;
if (i == 2)
{
int c = {1};
c[8] = 9;
}
}
catch (ArrayIndexOutOfBoundException e)
{
System.out.println("Abekus");
}
catch (ArithmeticException e)
{
System.out.println("Slack");
}
}
}
}