Logo

Java Questions Set 104:

Quiz Mode

Evaluate the following postfix expression: 6 3 2 4 + - *

1
2
3
4

Solution:

Which component is responsible for running Java programs?

1
2
3
4

Solution:

Which of these class contains only floating point functions?

1
2
3
4

Solution:

What is the maximum priority value that can be set to a thread in java.

1
2
3
4

Solution:

What type of testing is JUnit used for?

1
2
3
4

Solution:

Can command-line arguments be converted to int automatically if required?

1
2
3
4

Solution:

 How do define the user-defined exceptions? 

1
2
3

Solution:

Which two are valid constructors for the Thread class?

1
2
3
4

Solution:

 

class test {

public static void main (String[] args) {

     int var1=9;

              int var2=10;

              if(var1++==--var2)

                  System.out.println(var2--);

              else 

                  System.out.println(--var1);

      }

}

1
2
3
4

Solution:

Statement 1- add() method is used to add an element to the start of a LinkedList object 

Statement 2- Add() method is used to add an element to the start of a LinkedList object 

Statement 3- addFirst() method is used to add an element to the start of a LinkedList object 

Statement 4- AddFirst() method is used to add an element to the start of a LinkedList object 

1
2
3
4
5

Solution: