Programming MCQs

Java Objective Questions with Answers set-9

Pinterest LinkedIn Tumblr
Here are the collection of Java objective questions with answers includes multiple-choice questions on fundamental of java programming language. It includes objective questions on java arrayChar, byte code and Java compiler, and the Polymorphism in Java along with their answers.

1. In java a ………………….. is a sequence of characters.
A) string
B) arrayChar
C) groupChar
D) collection

2. Java programs perform I/O through ………..
A) I/O methods
B) I/O package
C) streams
D) compiler

3. What is byte code in the context of Java?
A) The type of code generated by a Java compiler
B) The type of code generated by a Java Virtual Machine
C) It is another name for Java source file
D) It is the code written within the instance methods of a class

4. Which of the following statements about abstract methods/classes in Java is true?
A) An abstract class cannot be instantiated.
B) Constructors can be abstract.
C) A subclass of an abstract class must defined the abstract methods.
D) Static methods may be declared abstract.

5. Which of the following statement is false?
A) The sleep() method should be enclosed in try ……… catch block
B) The yield() method should be enclosed in try ……… catch block.
C) A thread can be temporarily suspended from running by using the wait() method.
D) A suspended thread using suspend() method can be revived using the resume() method.

Read Also: Interview Questions on Operating System Basis

6. The new operator dynamically allocates …………..for an object and returns a reference to it.
A) classes
B) variables
C) memory
D) none of the above

7. Which of the following statements correctly describes an interface?
A) It’s a concrete class
B) It’s a super class
C) It’s a type of abstract class
D) It’s a subclass

8. What is the priority of the Garbage collector thread of jdk?
A) Low Priority
B) Highest Priority
C) Medium Priority
D) Decided at run time

9. ……………. is a feature that allows one interface to be used for a general class of actions.
A) Class
B) Inheritance
C) Polymorphism
D) Interface

10. The default package that is implicitly called in a java program is ………….
A) java.Lang
B) java.System
C) java.Window
D) java.Lang.System

Answers:

1. In java a ………………….. is a sequence of characters.
B) arrayChar

2. Java programs perform I/O through ………..
C) streams

3. What is byte code in the context of Java?
A) The type of code generated by a Java compiler

4. Which of the following statements about abstract methods/classes in Java is true?
A) An abstract class cannot be instantiated.

5. Which of the following statement is false?
B) The yield() method should be enclosed in try ……… catch block.

6. The new operator dynamically allocates …………..for an object and returns a reference to it.
C) memory

7. Which of the following statements correctly describes an interface?
C) It’s a type of abstract class

8. What is the priority of the Garbage collector thread of jdk?
A) Low Priority

9. ……………. is a feature that allows one interface to be used for a general class of actions.
C) Polymorphism

10. The default package that is implicitly called in a java program is ………….
A) java.Lang

Read Next: Java MCQ Interview Questions With Answers set-10
Read Also:
Operating System MCQ Questions Collections

Please follow and like us:
RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
linkedIn | Java Objective Questions with Answers set-9
Share

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.

RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
Share