30 TOP CORE JAVA MULTIPLE CHOICE QUESTIONS AND ANSWERS PDF

The Below List 30 top Real Time Core Java Multiple choice Questions and answers for freshers and experienced pdf free download

Core Java Multiple choice Questions and Answers List

1. ________ is the ability of an Java application to perform multiple tasks at the same time.
A) Multiprogramming
B) Multithreading
C) Multiprocessing
D) Multitasking
Ans: B

2. Java is designed for the distributed environment of the Internet, because it handles ________ protocols
A) UDP
B) TCP/IP
C) FTP
D) TEL
Ans: B

3. Java is associated with _______ programming Language
A) Oak
B) Basic
C) C
D) Perl
Ans: A

Core Java Multiple choice Questions
Core Java Multiple choice Questions

4.Which of the following is Java keyword?
A) external
B) implement
C) throw
D) Integer
Ans: C

5. A compiler converts the Java program into an intermediate language representation called
A)bytecode
B)byte
C)byteclass
D)bytejava
Ans: A

6. _______ Operator is used to create an object.
A) class
B) new
C) print
D) main
Ans: B

7. Which of the following method is used to initialize the instance variable of a class.
A) Class
B) Public
C) Constructor
D) Destructor _
Ans: C

8. Java platform consists of JVM and a package of readymade software components this
package is known as ________.
A) Java API
B) JVM API
C) JM API
D) API
Ans: A

9. Which of the following is not a Looping statement ________ .
A)FOR
B)Switch
C)while
D)Do-While
Ans: B

10. ________ is a multi way branch statement
A) Switch
B) continue
C) break
D) Label
Ans: A

11. Choose the proper operator precedence when evaluating an Expression?
1. Comparisons
2. Logical operations
3. Increment
4. Arithmetic operations
A) 1-2-4-3
B) 4-3-1-2
C) 2-1-4-3
D) 3-4-1-2
Ans: D

12. The ______ statement is used inside the switch to terminate a Statement sequence
A) break
B) Jump
C) exit
D) goto
Ans: A

13. A class that is inherited is called a ______ .
A) superclass
B) Subclass
C) subsetclass
D) Relativeclass
Ans: A

14. An _________ determines which features of a class may be used by other classes
A) specifier
B) inheritance
C) implementation
D) Access specifier
Ans: D

15. Which property of Java allows the creation of hierarchical classifications?
A) Interface
B) Inheritance
C) Robust
D) Distributed
Ans: B

16. Which of the following is WRONG statement with respect to rules for overriding Methods?
A) The method name and the order of arguments should be identical to that of the super
class method.
B) The return type of both the methods must be the different.
C) The overriding method cannot be less accessible than the method it overrides.
D) An overriding method cannot raise more exceptions than those raised by the super class.
Ans: B

17. The class at the top of the exception classes hierarchy is called ________.
A) Common
B) Throwable.
C) NULL
D) Catch
Ans: B

18. Find the keyword which is not used to implement exception
A) try
B) catch
C) finally
D) access
Ans: D

19. Which of the following is not a Exceptions in Java.
A) Arithmetic Exception
B) Nullpointer Exception
C) ArrayoutofBounds Exception
D) Logical Exception
Ans: B

20. Which of the following Definitions hold good for Exception?
A) Abnormal event that occurs during program execution and disrupts the normal flow of Instruction.
B) The unexpected situations that may occur during program execution
C) The term exception denotes an exception event.
Ans: D

21. Consider the following program:
import myLibrary.*;
public class ShowSomeClass
{
// code for the class…
}
What is the name of the java file containing this program?
A. myLibrary.java
B. ShowSomeClass.java
C. ShowSomeClass
D. ShowSomeClass.class
E. Any file name with the java suffix will do
Ans: B

22. Which of the following is TRUE?
A. In java, an instance field declared public generates a compilation error.
B. int is the name of a class available in the package java.lang
C. Instance variable names may only contain letters and digits.
D. A class has always a constructor (possibly automatically supplied by the java
compiler).
E. The more comments in a program, the faster the program runs.
Ans:D

23. Consider the following code snippet
String river = new String(“Columbia”);
System.out.println(river.length());
What is printed?
A. 6
B. 7
C. 8
D. Columbia
E. river
Ans:C

24. A constructor is ____.
A. must have the same name as the class it is declared within.
B. is used to create objects.
C. may be declared private
D. A and B
E. A, B and C
Ans:E

25. Which of the following may be part of a class definition?
A. instance variables
B. instance methods
C. constructors
D. all of the above
E. none of the above
Ans:D

26. What is different between a Java applet and a Java application?
A. An application can in general be trusted whereas an applet can’t.
B. An applet must be executed in a browser environment.
C. An applet is not able to access the files of the computer it runs on
D. (A), (B) and (C).
E. None of the above
Ans:D

27. Consider
public class MyClass{
public MyClass(){/*code*/}
// more code…
}
To instantiate MyClass, you would write?
A. MyClass mc = new MyClass();
B. MyClass mc = MyClass();
C. MyClass mc = MyClass;
D. MyClass mc = new MyClass;
E. It can’t be done.
Ans: A

28. The constructor of MyClass should be defined as
public void MyClass(){/*code*/}
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 a Java source file
D. It is the code written within the instance methods of a class.
E. It is another name for comments written within a program.
Ans:A

29. What is garbage collection in the context of Java?
A. The operating system periodically deletes all of the java files available on the
system.
B. Any package imported in a program and not used is automatically deleted.
C. When all references to an object are gone, the memory used by the object is
automatically reclaimed.
D. The JVM checks the output of any Java program and deletes anything that
doesn’t make sense.
E. Janitors working for Sun MicroSystems are required to throw away any
Microsoft documentation found in the employees’ offices.
Ans:C

30. You read the following statement in a Java program that compiles and executes.
submarine.dive(depth);
What can you say for sure?
A. depth must be an int
B. dive must be a method.
C. dive must be the name of an instance field.
D. submarine must be the name of a class
E. submarine must be a method.
Ans:B