Logo

Java Questions Set 242:

Quiz Mode

javap java.____.StringBuilder

1
2
3

Solution:

Which of these is a selection statement in Java?

1
2
3
4

Solution:

Which of this class is used to make a thread?

1
2
3
4

Solution:

Encapsulation is acheived by combing ________ into a class . 

1
2
3
4

Solution:

The array is a class which uses String as a key to store the value in the object  

1
2

Solution:

Which file is used to specify the packaging cycle?

1
2
3
4

Solution:

Which Java collection interface provides the capability to store objects using a key-value pair?

1
2
3
4

Solution:

what should be the output of this code block?

public class abekus {

  public static void main(String[] args) {

    System.out.print(2 > 4 ? "Hi" : "abekus");

  }

}

}

1
2
3
4

Solution:

What is the value returned by the compareTo() method if the invoking string is lexicographically less than the string compared?

1
2
3
4

Solution:

public class Demo123{

     public static void main(String args[]){

String s1= new String("hello");

String s2= new String("hello");

System.out.println(s1==s2);

System.out.println(s1.equals(s2));

   }

}

1
2
3
4

Solution: