Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please zoom in on the image or download the image. Public class PortDeBouc { string shipname, int build. no: string former pame: statis string seunty=Marsilya;

Please zoom in on the image or download the image.

image text in transcribed

Public class PortDeBouc { string shipname, int build. no: string former pame: statis string seunty="Marsilya"; h. If another class extends this class, which variable can not be directly used? (3 pts) i. If we run this program, what is the gutryt? (3 pts) publis. PortDeBeus(String name, int r, string eski) { shipname=name; build, pe=r; former.name = eski; } j. You see that the boat Heybeliada, also built in PortDeBousformer name Degirmen was. constructed later. Its serial number is 58. How can you instantiate this as Prenses? (3 pts) void displayit O{ System.out.println(shipname+""+build. ng** *+former same+""+seunts); k. If we gmit the following three lines. Will the program cun? If so, what is the gutput now) (3 Bts PortDeBoys(String n, int r, string eski) { shipname=name; build. 10=r; forme.name = eski; } } Rublic statis veid main(String args[]){ PortDeBous Boat1 = new PortDeBouse Moda, 41, "Fener"); PortDeBous Boat2 = new PortDeBoys("Kadikoy,42,"BogaHeykeli"); PartReBeus Boat3 = new PortDeBeus"Burgaz, 43, "Kalpazankaya"); Boat1.displayit(); Boat2.displayit(); Boat3.displayit(); } } Answer the following: Is there encapsulation here? If so where? (3 points) a. Is there polymorphism? Where? (3pt). 1. b. Identify the class name (3 pt). Write a header and two methods for a class Akay that inherits this class, adds getFormer name and setFormer name_method headers that sets and gets the former name of the boat as strings. Only headers are required. (5 points) c. Identify statement or statements that act as constructor(s) (3 pt) d. How many item(s) elements is (are) instantiated? Name them. Please-3 pts) e. What is the name of the method? (2 pts) f. Why do we declare displayit and main with the void attribute? (3 pts) g. Why do we declare main with the static attribute? (2 pts)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions