JVM always take a void return type
We have any code between try and finally blocks?
Which of the following is the direct subclass of the Panel class?
Predict the output of the following Java code.
public class outputs
{
public static void main(String args[])
{
int a = 3;
System.out.print(++a * 8);
}
}
What will be the output of the following Java program?
class Output
{
public static void main(String[] args)
{
String s1 = "one";
String s2 = s1 + " two";
System.out.println(s2);
}
}
class test{
public static void main (String[] args) {
int a,b,c,d;
a=b=c=d=40;
a-=b*=c+=d/=-5;
System.out.println(a+" "+b+" "+c+" "+d);
}
}
public class abekus{
public static void main(String[] args){
int a = 0;
a +=5;
switch(a){
case 5: System.out.print("five"); break;
case 10:
if(a%2==0) System.out.print("even");
else System.out.print("odd");
break;
default: System.out.print("0-2");
}
}
}
//Predict the output
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
StringBuilder str = new StringBuilder("apple");
int unicode = str.codePointAt(4);
System.out.println(" "+ unicode);
}
}
Predict the output of the following Java code.
class AbekusParent {
public void show() {
System.out.println("AbekusParent :: show() -> called");
}
}
class AbekusChild extends AbekusParent {
public void show() {
System.out.println("AbekusChild :: show() -> called");
}
}
public class Main {
public static void main(String[] args) {
AbekusParent a = new AbekusChild();
a.show();
}
}