Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews. Program prints all the methods and data member of ‘java.awt.Dimension’ package. Which of the following is an incorrect statement regarding the use of generics and parameterized types in Java?
Following quiz provides Multiple Choice Questions (MCQs) related to Core Java. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Objects are stored on Stack.
Answer : B
Explaination
Objects are allocated memory in heap memory space.
Q 2 - What is the size of char variable?
Answer : B
Explaination
The char data type is represented by single 16-bit Unicode character.
Minimum value: 'u0000' (or 0)
Maximum value: 'uffff' (or 65,535)
Q 3 - What is the default value of char variable?
Answer : A
Explaination
char variable has default value of 'u0000' if defined as an instance/static variable.
Q 4 - Which of the following is true about protected access modifier?
Answer : B
Explaination
Variables, methods, and constructors which are declared protected can be accessed by any class lying in the same package.
Q 5 - Inheritance represents
Answer : B
Explaination
Inheritance represets IS-A relationship providing code reusablity . Consider the following statement: Circle is a Shape.Here Shape is super class and Circle is a child class extends the super class Shape.
Q 6 - Can be constructor be made final?
Q 7 - What is true about a final class?
Answer : D
Explaination
Final classes are created so the methods implemented by that class cannot be overridden. It can't be inherited. These classes are declared final.
Q 8 - What is Serialization?
Answer : B
Explaination
Serialization is the process of writing the state of an object to a byte stream.
Q 9 - Under what conditions is an object's finalize() method invoked by the garbage collector?
Answer : A
Explaination
The garbage collector invokes an object's finalize() method when it detects that the object has become unreachable.
Q 10 - This is the parent of Error and Exception classes.
Answer : A
Explaination
Throwable is the parent of both Error and Exception class.