Java MCQ Questions with Answers
Very Important Questions for Diploma Students
1. Which of the following has highest memory requirement?
Answer : C
2. Which of these operators is used to allocate memory for an object ?
Answer : C
Explanation : New operator dynamically allocates memory for an object.
3. In Java objects are passed as :
Answer : D
4. Which is a reserved word in the Java Programming language ?
Answer : B
5. Command to execute a compiled Java program is :
Answer : B
Explanation : Command Java is used to execute compiled program and Java C is used to compile java program.
Java MCQ
6. The default value of a static integer variable of a class in Java :
Answer : A
7. In Java objects are created by which keyword ?
Answer : B
8. The process by which one object acquires the properties of another object is called :
Answer : D
9. Java Compiler Java C translate Java source code into :
Answer : B
10. Which operator is used for concatenation in Java ?
Answer : D
Explanation : ‘+’ operator in java can be used to add numbers and concatenate strings.
Java MCQ
11. Which of these keywords must be used to monitor for exceptions ?
Answer : A
12. Which of these keywords is used to manually throw an exception ?
Answer : C
Explanation : “throw’ keyword is used for throwing exception manually in java program.
13. Which of these is not a bitwise operator ?
Answer : B
14. What is the output of relational operators ?
Answer : B
Explanation : The output of relational operator is boolean value which is true or false.
15. Which of these have highest precedence ?
Answer : A
Java MCQ
16. Which of these method is used to find out that a thread is still running or not ?
Answer : C
Explanation : isAlive() method is used to check whether the thread being called is running or not.
17. Which of these are types of Multitasking ?
Answer : C
Explanation : There are two types of multitasking: Process based multitasking and Thread based multitasking.
18. Which of these coding types is used for data type characters in Java ?
Answer : C
Explanation : Unicode defines fully international character set that can represent all the characters found in all human languages.
19. What is the range of data type byte in Java ?
Answer : A
20. Thread priority in Java is :
Answer : A
Explanation : Java assigns to each thread a priority that determines hoe that thread should be treated with respect to others. Thread priority is integers that specify relative priority of one thread to another.
Related Links