πŸ§ͺ Java MCQ Quiz Hub

Java Mcq Question Set 1

Choose a topic to test your knowledge and improve your Java skills

Java is a ........... language.





βœ… Correct Answer: 2

How many primitive data types are there in Java?





βœ… Correct Answer: 4

In Java byte, short, int and long all of these are





βœ… Correct Answer: 1

Size of int in Java is





βœ… Correct Answer: 3

The smallest integer type is ......... and its size is ......... bits.





βœ… Correct Answer: 2

Size of float and double in Java is





βœ… Correct Answer: 1

Automatic type conversion in Java takes place when





βœ… Correct Answer: 2

Which of the following automatic type conversion will be possible?





βœ… Correct Answer: 4

The following fraction of code double STATIC = 2.5 ; System.out.println( STATIC );





βœ… Correct Answer: 1

The following program: public class Test{ static boolean is OK; public static void main(String args[]){System.out.print(is OK); } }





βœ… Correct Answer: 2

οΏ½In Java, the word true is ................





βœ… Correct Answer: 1

What will the output of the following program? public class Test{ public static void main(String args[]){float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); } }





βœ… Correct Answer: 1

οΏ½What is the output for the below code ? public class Test{public static void main(String[] args){int i = 010; int j = 07;System.out.println(i); System.out.println(j); } }





βœ… Correct Answer: 2

οΏ½What will be output of following program? public class Test{public static void main(String[] args){byte b=127; b++; b++; System.out.println(b); } }





βœ… Correct Answer: 2

οΏ½Which class cannot be subclassed (or extended) in java?





βœ… Correct Answer: 1

Why we use array as a parameter of main method





βœ… Correct Answer: 1

Suspend thread can be revived by using





βœ… Correct Answer: 4

Runnable is





βœ… Correct Answer: 1

Which collection class associates values witch keys, and orders the keys according to their natural order





βœ… Correct Answer: 2

Which method is used to perform DML statements in JDBC





βœ… Correct Answer: 1

Which of the following below are valid isolation levels in J2EE





βœ… Correct Answer: 4

Which metrhods are utilized to control the access to an object in multi threaded programming





βœ… Correct Answer: 1

Program which executes applet is known as





βœ… Correct Answer: 3

Which statement is static and synchronized in JDBC API





βœ… Correct Answer: 1

The JDBC-ODBC bridge is





βœ… Correct Answer: 2

All raw data types should be read and uploaded to the database as an array of





βœ… Correct Answer: 2

The class java.sql.Timestamp is associated with





βœ… Correct Answer: 1

Which of the following statements about arrays is syntactically wrong





βœ… Correct Answer: 4

Converting a primitive type data into its corresponding wrapper class object instance is called





βœ… Correct Answer: 3

Package of drawstring() method is





βœ… Correct Answer: 1

Which method executes only once





βœ… Correct Answer: 3

Object which can store group of other objects is called





βœ… Correct Answer: 4

All collection classes are available in





βœ… Correct Answer: 1

Thread class is available in





βœ… Correct Answer: 1

Minimum threads in a program are





βœ… Correct Answer: 2

JIT meaning





βœ… Correct Answer: 1

After the compilation of the java source code, which file is created by the JVM





βœ… Correct Answer: 1

pow () is associated with which class





βœ… Correct Answer: 3

x=x+1 is equivalent to





βœ… Correct Answer: 1

If method have same name as class name and method don't have any return type then it is known as





βœ… Correct Answer: 1

Methods that have same name, but different Parameter list and different definition known as





βœ… Correct Answer: 2

Inheritance means





βœ… Correct Answer: 3

Which type of inheritance is not supported by java





βœ… Correct Answer: 4

String is the predefined





βœ… Correct Answer: 3

Super is the predefined





βœ… Correct Answer: 3

Execution of the program is always begins with





βœ… Correct Answer: 1

In java, gc() method is available in which package





βœ… Correct Answer: 2

JAR file contains the compressed version of





βœ… Correct Answer: 3

Process of creating exact copy of the existing object is called





βœ… Correct Answer: 3