Logo

Java Questions Set 161:

Quiz Mode

  Java system properties are retrieved by System.getenv() 

1
2

Solution:

The class string belongs to which package

1
2
3
4

Solution:

Which of the following right shift operators preserves the sign of the value?

1
2
3
4

Solution:

In a class, encapsulating an object of another class is called

1
2
3
4

Solution:

Another word for "repeating" a set of statements is:

1
2
3
4

Solution:

class test{

public static void main (String[] args) {

 byte b=120;

 b+=8;

 System.out.println(b);

}

}

1
2
3
4

Solution:

Which of these methods are used to register a keyboard event listener?

1
2
3
4

Solution:

Which of these statements about try-catch-finally blocks is incorrect?

1
2
3
4

Solution:

What will be the output of the following Java program?


import java.io.*;

import java.net.*;

public class URLDemo

{

public static void main(String[] args)

{

try

{

URL url = new URL("https://abekus.co/java-mcq");

System.out.println("Protocol: " + url.getProtocol());

System.out.println("Host Name: " + url.getHost());

System.out.println("Port Number: " + url.getPort());

} catch (Exception e) { System.out.println(e); }

}

}

1
2
3
4

Solution: