Logo

Java Questions Set 128:

Quiz Mode

Static access by reference

1
2

Solution:

Which class is MouseEvent a subclass of?

1
2
3
4

Solution:

Which of the following methods is used to start a thread's execution?

1
2
3
4

Solution:

Which function returns the absolute value of a variable?

1
2
3
4

Solution:

How to read an entire file in one line using Java 8?

1
2
3
4

Solution:

If we want a field or variable in the object not to be saved, then we declare that variable or field as transient.

1
2

Solution:

Which of these methods of the String class is used to compare two String objects for their equality?

1
2
3
4

Solution:

import java.util.*;

public class check{

public static void main(String args[]){

int a=10;

int b=20;

int c=10;

int output=0;

output=a++ + b++ + c++;

System.out.println(output);

}

}

1
2
3
4

Solution:

What will be the output of the following code?

class A{

    public static void main(String args[])  {

       System.out.println(1  +  2 + "Abekus"); 

       System.out.println("Abekus" + 1 + 2); 

   }  

}

1
2
3
4

Solution:

What will be the correct output?

public class Main {

 int x=9;

 public void add(int i)

 {

  System.out.println("integer value passed.");

 }

 public void add(float i)

 {

  System.out.println("float value passed.");

 }

 public static void main(String[] args) {

  Main m=new Main();

  m.add(10);

 }

}

1
2
3
4

Solution: