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

Java question: Select whether each of the following is true for abstract classes

ID: 3918212 • Letter: J

Question

Java question:

Select whether each of the following is true for abstract classes only, interfaces only, both, or neither.

can be used as the declared type of an object

a. interfaces only b. neither c.abstract classes only d.both abstract classes and interfaces      

can be used as the actual (runtime) type of an object

a. interfaces only b. neither c. abstract classes only d. both abstract classes and interfaces      

can have a constructor

a. interfaces only b. neither c. abstract classes only d. both abstract classes and interfaces      

can have abstract methods

a. interfaces only b. neither c. abstract classes only d. both abstract classes and interfaces      

can contain private variable

a. interfaces only b. neither c.abstract classes only d.both abstract classes and interfaces

Explanation / Answer

ANSWER 1: Here option(B) is correct because both do not have an object type.

ANSWER 2: Here also option(C) is correct because an abstract class can have the constructor.

ANSWER 3: Here option(C) is correct no doubt.

ANSWER 4: here option(D) is correct because both can have abstract methods.

ANSWER 5: Here option(C) is correct only abstract class can have the private variables.

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