Logo

Java Questions Set 125:

Quiz Mode

go-to is  not a valid jump statement 

1
2

Solution:

Which of the following keyword is used to make a class?

1
2
3
4

Solution:

Which of the following operators can operate on a boolean expression?

1
2
3
4

Solution:

 The correct way of inheriting class A by class B 

1
2
3
4

Solution:

Which of the following is invalid?

1
2
3
4

Solution:

check the following statements

Statement 1 - \t

Statement 2 - \r

Statement 3 - \a

Statement 4 - \s

1
2
3
4

Solution:

class test {

public static void main (String[] args) {

   String s1=new String("Hello");

   String s2=new String("Hello");

   System.out.println((s1==s2)+" "+(s1.equals(s2)));

}

}

1
2
3
4

Solution:

 

class test {

public static void main (String[] args) {

       int x;

       x=5;

       {

            int y=6;

            System.out.println(++x+" "+y++);

       }

       System.out.println(x);

      }

}

1
2
3
4

Solution:

 

public class j 

{

public static void main(String args[])

String s1 = new String("Java is plaform independent");

boolean result;

result= s1.startsWith("java");

System.out.println(result);

}

}

1
2
3
4

Solution:

Predict the output of the following Java code:

class Abekus {

public static void main(String args[])

{

String str = "JavaProgramming";

String str1 = "Java";

System.out.println(str.compareTo(str1));

System.out.println(str1.compareTo(str));

}

}

1
2
3
4

Solution: