Predict the output of the following Java code.
Statement- Short= 2 byte
Statement- Float = 4 byte
Statement- long = 8 byte
Statement- integer= 6 byte
Which of the following is/are legal method declarations?
Predict the output of the following Java code:
import static java.lang.System.out;
class Abekus
{
public static void main(String[] args) {
out.println("Welcome on Abekus.");
}
What will be the output of the following code?
class A{
public static void main(String args[]) {
int arr[] = new int[2];
System.out.println(arr[0]);
System.out.println(arr[1]);
}
}
What is the output of the following Java program?
class Abekus {
public static void main(String args[]) {
System.out.println(function());
}
static int function() {
return 100;
}
}
Which of these is the correct way of defining a generic method?
Predict the output of the following Java code.
class Abekus {
public static void main(String[] args) {
for(int i = 0; i < 1; i++) {
System.out.println("Welcome to Abekus");
break;
}
}
}
Statement 1- Generic methods are methods that introduce their own type parameters
Statement 2- Generic methods are methods that take void parameters
Statement 3- Generic methods are the methods that extend generic class methods