Logo

Java Questions Set 1:

Quiz Mode

The ______ keyword is used to declare constants in Java.

1
2
3
4

Solution:

Which of the following is not a predefined Java package?

1
2
3
4

Solution:

Which of the following values can be represented by a float variable?

1
2
3
4

Solution:

which of the following is allowed before the package declaration statement?

1
2
3
4

Solution:

The following example demonstrates the creation of which type of Java Applet?

1
2
3
4

Solution:

Which access specifier can be used for a class so that its members can be accessed by a different class in a different package?

1
2
3
4

Solution:

The output of the following Java program.

class Main {

 public static void main(String args[]){

  final int i;

  i = 20;

  i = 30;

  System.out.println(i);

 }

}

1
2
3
4

Solution:

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);

  }

}

1
2
3
4

Solution:

What happens when we access the same variable defined in two interfaces implemented by the same class?

1
2
3
4

Solution:

Which of these statements about operator precedence are incorrect?

1
2
3
4

Solution: