Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following test is related to questions 1, 2 and 3: Suppose Emotable is an in

ID: 2247103 • Letter: T

Question

The following test is related to questions 1, 2 and 3: Suppose Emotable is an interface and class Bird implements Emotable. Also assume that class BigBird extends Bird. Now consider the following code. Emotable e = new BigBird(): Bird b = new Bird(): How many instances of Bird are created in the code above? a) 0 b) 1 c) 2 d) 3 e) 4 How many Bird objects are created in the code above? a) 0 b) 1 c) 2 d) 3 e) 4 How many Bird classes exist? a) 0 b) 1 c) 2 d) 3 e) 4 Abstract classes and interfaces are very similar. One difference is that: a) Abstract classes can have constructors b) Interfaces can contain state c) Interfaces can be instantiated d) Abstract classes cannot have static methods e) None of the above Use case diagrams a) Describe the order in which classes and actors interact with each other b) Describe what functionality is needed by actors that interact with the c) Describe class attributes, operations, and how classes relate to each d) Describe the state transformations made between object instance e) All of the above

Explanation / Answer

1)Ans) b

Reason:

Bird b=new Bird();

here b is instance variable which is pointing to the Bird class object.

______________

2)Ans) C

when we call Emotable e=new BigBird();

Internally its super class Bird class Object will be created.

and also whn we call Bird b=new Bird(); another Bird Class Object will be created.

_________________

3)Ans) 2

Reason: Bird is a class of Type Bird and also BigBird is also a Bird type class.

_________________

4)Ans) a

we can have constructors in the abstract class.

________________

5)Ans) a

_______________Thank you

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote