Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA only. Instructions Write a Java class named Ship to meet the requirements described in the following UML Class Diagram Ship Attributes private name: String

JAVA only.image text in transcribed

image text in transcribed

Instructions Write a Java class named Ship to meet the requirements described in the following UML Class Diagram Ship Attributes private name: String private type: String private year: int private builder: String Name of the ship Type of the ship Year of build Builder company Operations Ship(name: String, Default or null constructor Constructor accepting four(4) parameters. Returns a fully formed and fully functional Ship object reference type: String, year: int, builder: String): Ship public setName(aName: String): void public setType(aType: String): void public setYear(aYear: int): void public setBuilder(aBuilder: String): void Accepts a String object(local name:aBuilder) and assigns public getName: String Accepts a String object(local name:aName) and assigns it to the instance variable name Accepts a String object(local name:aType) and assigns it to the instance variable type Accepts an int value(local name:aYear) and assigns it to the instance variable year it to the instance variable builder Returns the current value of instance variable name Returns the current value of instance variable t Returns the current value of instance variable year Returns the current value of instance variable builder Strin ublic getT public getYearl): int public getBuilder): String Returns a formatted String containing a 'state report that is, the current values of each of the object's instance variable public toString:String

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

Students also viewed these Databases questions

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago