Question: Following the steps and Using Java OO language to create java classes and subclasses. Each concrete class need to have a toString() method to define

Following the steps and Using Java OO language to create java classes and subclasses. Each concrete class need to have a toString() method to define that prints out its attributes.

The attributes must be private! Error checking is necessary.

Following the steps and Using Java OO language to create java classes

and subclasses. Each concrete class need to have a toString() method to

define that prints out its attributes. The attributes must be private! Error

Step 1:Define an interface Contact 1. That has the following methods (notice that some are for type String, this means you'll have to convert them to int's) 1. getLength/setLength (int) 2. getSpeed/setSpeed (int) 3. setSpeed(String) 4. getName/setName (String) 5. getType/setType (String) (This is an arbitrary string label for anything of class Contact) Step 2: Define an abstract class Ship that implements the Contact Interface. The methods in contact should be defined (no longer abstract, but they can be overriden later on). Step 3: Define a class Destroyer that subclasses Ship 1. that has the following attributes and get/set methods. Supports int and String setNumberMissiles() arguments. If the String argument of setNumberMissiles(0 encounters a parsing error, set the numberMissiles to 2. 1. numberMissile

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!