×
Login Or SignUp
Privacy Policy
Terms Of Service
freetests4u.com
Online Knowledge Sharing Platform
Login/SignUp
freetests4u.com
Blogs
Mock Tests
Videos
Jobs
46 .
Which of these keywords is used to refer to member of base class from a sub class ?
A.
upper
B.
super
C.
this
D.
None of the mentioned
View Answer
Ans: super
47 .
Why we use array as parameter in main method ?
A.
It is syntax
B.
Can store multiple values
C.
Both of above
D.
None of above
View Answer
Ans: Can store multiple values
48 .
Which of the following is NOT true about main method ?
A.
We can overload main method
B.
In a single package there can be only one main method
C.
In a package there we can write main method per class
D.
Main method is entry point method
View Answer
Ans: In a single package there can be only one main method
49 .
Select correct choice regarding up casting
A.
Explicit typecasting is not mandatory in up casting.
B.
In case of up casting, using super class reference variable, we can access fields of subclass
C.
Both A and B are correct
D.
Neither A and B is correct
View Answer
Ans: Explicit typecasting is not mandatory in up casting.
50 .
Which of these is correct way of inheriting class A by class B ?
A.
class B + class A {}
B.
class B inherits class A {}
C.
class B extends A {}
D.
class B extends class A {}
View Answer
Ans: class B extends A {}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17