Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q51: Overloading in Java occurs when:
- A: Two or more methods have the same name but different parameters
- B: Two methods have the same name and same parameters
- C: Two classes have the same name but different methods
- D: Two classes have different methods but same parameters
View Answer
A
Q52: Which of the following is an example of method overloading?
- A: Print(text_object T); Print(image_object P);
- B: Print(Object O);
- C: Print(int x); Print(double y);
- D: Print(); Print();
View Answer
A
Q53: What must differ in overloaded functions?
- A: Data types
- B: Return types
- C: Access specifiers
- D: Method names
View Answer
A
Q54: In method overriding, the method in the child class:
- A: Has a different name from the parent class method
- B: Has the same name and parameters as the parent class method
- C: Has a different return type
- D: Has different access specifiers
View Answer
B
Q55: In the example provided, what will the output be when Boy obj = new Boy(); obj.eat(); is executed?
- A: Boy is eating.
- B: Human is eating.
- C: Animal is eating.
- D: Object is eating.
View Answer
A
Q56: Which of the following best describes polymorphism in OOP?
- A: Ability of a function or object to take on multiple forms
- B: Ability to overload methods
- C: Ability to override methods
- D: Ability to inherit from multiple classes
View Answer
A
Q57: Which type of polymorphism is achieved using inheritance and virtual functions?
- A: Compile-time polymorphism
- B: Runtime polymorphism
- C: Operator overloading
- D: Function overloading
View Answer
B
Q58: What will be the output of dog.bark() if dog is a reference of type Dog pointing to an object of type Hound?
- A: Bowl
- B: Woof
- C: Howl
- D: Sniff
View Answer
A
Q59: In dynamic binding, when does the binding occur?
- A: Compile-time
- B: Runtime
- C: Link-time
- D: Load-time
View Answer
B
Q60: Up-casting in Java refers to:
- A: Converting a smaller datatype to a larger datatype
- B: Converting a larger datatype to a smaller datatype
- C: Converting a float to int
- D: Converting a double to float
View Answer
A