Java Multiple Choice Questions

0

1) Which of the following option leads to the portability and security of Java?

  1. Bytecode is executed by JVM
  2. The applet makes the Java code secure and portable
  3. Use of exception handling
  4. Dynamic binding between objects

2) Which of the following is not a Java features?

  1. Dynamic
  2. Architecture Neutral
  3. Use of pointers
  4. Object-oriented

3) What will be the output of the following program?

public class MyFirst {  
      public static void main(String[] args) {  
         MyFirst obj = new MyFirst(n);  
 }  
 static int a = 10;  
 static int n;  
 int b = 5;  
 int c;  
 public MyFirst(int m) {  
       System.out.println(a + ", " + b + ", " + c + ", " + n + ", " + m);  
   }  
// Instance Block  
  {  
     b = 30;  
     n = 20;  
  }   
// Static Block  
  static   
{  
          a = 60;  
     }   
 }  
  1. 10, 5, 0, 20, 0
  2. 10, 30, 20
  3. 60, 5, 0, 20
  4. 60, 30, 0, 20, 0

4) _____ is used to find and fix bugs in the Java programs.

  1. JDK
  2. JVM
  3. JRE
  4. JDB

Kalo Kalam
WRITTEN BY

Kalo Kalam

Sharing educational resources for Engineering, NEB and Vocational Classes of Nepal.

Leave a Reply

Your email address will not be published. Required fields are marked *