🧪 Java MCQ Quiz Hub

Java Mcq Question Set 1

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

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




2. How many primitive data types are there in Java?




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




4. Size of int in Java is




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




6. Size of float and double in Java is




7. Automatic type conversion in Java takes place when




8. Which of the following automatic type conversion will be possible?




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




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




11. �In Java, the word true is ................




12. 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); } }




13. �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); } }




14. �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); } }




15. �Which class cannot be subclassed (or extended) in java?




16. Why we use array as a parameter of main method




17. Suspend thread can be revived by using




18. Runnable is




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




20. Which method is used to perform DML statements in JDBC




21. Which of the following below are valid isolation levels in J2EE




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




23. Program which executes applet is known as




24. Which statement is static and synchronized in JDBC API




25. The JDBC-ODBC bridge is




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




27. The class java.sql.Timestamp is associated with




28. Which of the following statements about arrays is syntactically wrong




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




30. Package of drawstring() method is




31. Which method executes only once




32. Object which can store group of other objects is called




33. All collection classes are available in




34. Thread class is available in




35. Minimum threads in a program are




36. JIT meaning




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




38. pow () is associated with which class




39. x=x+1 is equivalent to




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




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




42. Inheritance means




43. Which type of inheritance is not supported by java




44. String is the predefined




45. Super is the predefined




46. Execution of the program is always begins with




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




48. JAR file contains the compressed version of




49. Process of creating exact copy of the existing object is called