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

AL. (5 marks) Fill in the blanks Use the most suitable words given in the box su

ID: 3739338 • Letter: A

Question

AL. (5 marks) Fill in the blanks Use the most suitable words given in the box superchss private ymorphism child chss Information hding encapsulation extends Tinal super masking a. The keywords that creates inheritance is b. whaa ?dclass method has he same name and argument types as a superclass method, he subclass method can override the superclass method. This concept is known as C. When you instantiate an object that is a member of a subclass, the constructor is cxecutes first d. A subelass cannot override static methods and e. In Java, the concept of keeping data private is known as A2.(20 marks) methods defined in a supercla a Daw a U/MI. class diagram named Rectangleshape to represent a rectangle. The class contains Two doubke data fields namod width and height hat specify the width and height of the rectangle A no-arg constructor that creates a default rectangle A constructor that creates a rectangle with the specified width and height A method namod getAreaO that retums the area of this rectangle A method named getPerineter O that returns the perimeter (7 marks) besod on the anr in part (a, implement the class (13 marks)

Explanation / Answer

A1
a) extends :- extends is a key word that is used to inherit base class into subclass
b) polymorphism :- it is concept in which function with same name with different argument list (or same argument list when define in two different class in case of inheritence) exist under comman code. This concept is also known as run time polymorphism
c) superclass
d) private :- private methods and variable of base class are not not accessible by subclass
e) Encapsulation :- The concept of keeping data private in JAVA(or OOP) is known as encapsulation .JAVA provides encapsulation using 'class information hiding'.

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