Predict the output of the following Java code.
Which method returns the elements of an Enum class?
class GFG {
public static void main (String[] args) {
int b=~4;
System.out.println(b);
}
}
What is the value of ‘E’ defined in Math class?
class test{
public static void main (String[] args) {
int x = -4,y=4;
System.out.println(x>>2+" "+y<<1);
}
}
Which of the following specifier must be used for class to make it able to be inherited by another subclass?
What is the output of the following code?
class Test
{
public static void main(String[] args)
{
int var1 = 5;
int var2 = 6;
if ((var2 = 1) == var1)
System.out.print(var2);
else
System.out.print(++var2);
}
}
What is serialization?
Would any Exception or Error occur when the program is executed?
public class program {
public static void main(String[] args) {
int a[] = {0,1,2,3,4};
int index = 0;
while (a[index]==index) {
System.out.println(a[index]);
index++;
}
}
}