Java concepts and its programming – MCQs

80 questions. Click to practice.

Correct options are highlighted when revealed.

1.What is the reason for using an array as a parameter in the main method?

2.What do you call methods that share the same name but differ in their parameter lists and implementations?

3.What is the total number of keywords defined in the Java programming language?

4.What is the total number of primitive data types available in Java?

5.What is the name of the program that runs an applet?

6.What is the output of the following Java program? public class Test { public static void main(String[] args) { byte b = 127; b++; b++; System.out.println(b); } }

7.What are the sizes, in bits, of the float and double data types in Java?

8.Which package contains all the collection classes in Java?

9.When does automatic type conversion occur in Java?

10.Which form of inheritance is supported by the use of interfaces?

11.What does a package typically consist of?

12.Which JDBC method is utilized to execute DML operations?

13.The function pow() belongs to which class?

14.Which technology enables Java code running on the JVM to interact with native applications by both invoking and being invoked by them?

15.Considering the classes below, which description best represents the data fields present in an instance of class B? class A { private int i; protected int j; } class B extends A { private int k; protected int m; }

16.What will be the output of the following code snippet? double STATIC = 2.5; System.out.println(STATIC);

17.In what format should all raw data types be read and stored in the database?

18.What type of predefined entity is a String in programming?

19.Which file type represents an executable applet?

20.Which of the following is not included in Java's Collection Framework?