الأربعاء، 4 ديسمبر 2013

Java Objective Questions with Answers set-9


1. In java a ....................... is a sequence of characters.

Java Objective Questions with Answers
Schema of the general architecture of a program running in a Java Virtual Machine (Photo credit: Wikipedia)

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.



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



Related Posts


0 التعليقات: