Predict the output of the following Java code.
Try and catch prevents automatic terminating of the program in cases when an exception occurs
Which of the following classes in Java is mutable?
Predict the output of the following Java code.
class test{
public static void main (String[] args) {
int a=64;
int b=32;
int c=~a|~b;
System.out.print(c|a);
}
}
Which of these Java classes can return more than one character to the input stream?
What will be the output of the following Java code?
What will be the output of the program?
class BitShift
{
public static void main(String [] args)
{
int x = 0x80000000;
System.out.print(x + " and ");
x = x >>> 31;
System.out.println(x);
}
}
What will be the correct output?
public class Main {
int x=9;
public void add(int i)
{
System.out.println("integer value passed.\n");
}
public void add(float i)
{
System.out.println("float value passed.\n");
}
public static void main(String[] args) {
Main m=new Main();
m.add('a');
}
}
Predict the output of the following Java code:
class Abekus {
public static void main(String args[])
{
String str1 = "Hello";
char arr[] = { 'H', 'e', 'l', 'l', 'o', ' ', 'A',
'b', 'e', 'k', 'u', 's' };
String str2 = new String(arr);
System.out.println(str1);
System.out.println(str2);
}
}