NEW
Font size
WorksheetsJava_MCQ_3
Total questions: 15
Worksheet time: 14mins
Which of this statement is incorrect?
All object of a class are allotted memory for the all the variables defined in the class
If a function is defined public it can be accessed by object of other class by inheritation
main() method must be made public
All object of a class are allotted memory for the methods defined in the class
What will be the output of the following Java code?
0 0
5 6
6 5
5 5
What is the output of the following Java code?
5
0
Garbage Value
-1
What is the output of the following Java code?
5
0
Garbage Value
-1
When does Exceptions in Java arises in code sequence?
Run Time
Compilation Time
Can Occur Any Time
None of the mentioned
What is the output of the following Java code?
Garbage value
7 5
5 7
5
What will be the output of the following Java program?
Hello
World
HelloWorld
Hello World
Which of these is not a correct statement?
Every class containing abstract method must be declared abstract
Abstract class defines only the structure of the class not its implementation
Abstract class can be initiated by new operator
Abstract class can be inherited
Which of these packages contains abstract keyword?
What is the output of the following Java code?
8
10
0
Compilation Error
What will be the output of the following Java code?
1 2
2 1
Runtime Error
Compilation Error
What will be the output of the following Java program?
0
1
2
Compilation Error
All classes in Java are inherited from which class?
java.lang.class
java.class.inherited
java.class.object
java.lang.Object
When does method overloading is determined?
At run time
At compile time
At coding time
At execution time
What will be the output of the following Java program?
0
2
4
None of the mentioned
