Programming - Methods in Java
You Are Here :: Home > JAVA > Methods in Java - General Questions
31. |
___________________ methods are Static Methods
|
A. |
Abstract |
B.
|
Instance |
C.
|
Factory
|
D.
|
Non Static
|
|
Answer: Option C
Explanation:
Static Methods are nothing but Factory Methods. |
|
32. |
A _____________ method is a method that creates and returns an object to the class to which it belongs?
|
A. |
Abstract |
B.
|
Instance |
C.
|
Factory
|
D.
|
Non Static
|
|
Answer: Option C
Explanation:
A Factory method is a method that creates and returns an object to the calss to which it belongs. |
|
33. |
In how many ways can you create an object in Java?
|
|
Answer: Option D
Explanation:
There are four ways to create an object. |
|
34. |
Writing two or more methods with the same name is called ____________________________.
|
A. |
Method Overloading |
B.
|
Method Overriding |
C.
|
both
|
D.
|
none
|
|
Answer: Option A
Explanation:
Writing two or more methods with the same name is called Method Overloading. |
|
35. |
Writing two or more methods with the same name and same signature is called ____________________________.
|
A. |
Method Overloading |
B.
|
Method Overriding |
C.
|
both
|
D.
|
none
|
|
Answer: Option B
Explanation:
Writing two or more methods with the same name and same signature is called Method Overriding. |
|
36. |
___________________ represents the method name along with method parameters.
|
A. |
Method |
B.
|
Method Overriding |
C.
|
Method Signature
|
D.
|
Both A and B
|
|
Answer: Option C
Explanation:
Method Signature represents the method name along with method parameters. |
|
« prev
next »