Which constructor is used to create an empty String object?
The method used to clear all data present in output buffers is
Which class is at the top of the Java event class hierarchy?
Which of these types cannot be used to initiate a generic type?
public class operator {
public static void main(String[] args)
{
int a = 40, b = 20, c = 35, output;
output = ((a < b) ? (a < c) ? a : c : (b < c) ? b : c);
System.out.println(output);
}
}
What is the output of the following Java code?
public class Test {
public static void main(String[] args) {
int x = 4;
int y = x++;
System.out.print(x + " " + y);
}
}
class test{
public static void main (String[] args) {
byte x = 4;
int i;
byte y;
i = x >> 2;
y = (byte) (x << 2);
System.out.print(i + " " + y);
}
}
What is the output of the following Java code?
class Main
{
public static void main(String[] args)
{
int sum=0;
for(int i=0,j=0; i<5 && j<5 ; i++,j=i+1)
{
sum+=i;
}
System.out.println(sum);
}
}
Select the correct option for the following Java code.
import java.io.*;
class Abekus {
public static void main (String[] args) {
byte a = 20; // line 1
byte b = 30; // line 2
a++; // line 3
b=b+1; // line 4
byte c = a+b;// line 5
System.out.println(c);
}
}