Question: Using the IST Linux system create the following Java command line inheritance application Lab11. Create the following project Java files: Point.java, Shape.java, Circle.java, Triangle.java, Rectangle.java,
Using the IST Linux system create the following Java command line inheritance application Lab11. Create the following project Java files: Point.java, Shape.java, Circle.java, Triangle.java, Rectangle.java, and Lab11Oakes.java
Point.java will contain two coordinates x and y. This will be reused to create point objects for all the shapes.
Shape.java will be a parent class and will contain a Point type.
Circle.java, Triangle.java, Rectangle.java will all be children of Shapes.java class
Each class (Circle, Triangle, Rectangle) will contain the private class x and y point type variables needed to draw the shape.
Each class (Circle, Triangle, Rectangle) will contain two constructor methods
constructor no input arguments but will set (hardcoded) the private point variables needed to represent the shape. It will also print out the shape type and the points set for that shape.
constructor the number of point type arguments needed to set the private point variables needed to represent the shape. It will also print out the shape type and the points set for that shape.
Lab10.java will be the starting point for running the program
Lab10.java will create three objects one from the Circle class, one from Triangle class, and one from Rectangle class.
Each class will perform two calls:
Call 1. no input argument constructor that shows the points of that shape
Call 2. containing hardcoded point values that show the points of that shape
ublic class Circle extends Shapet int radius; public Circle()1 p1new Point (2,3); radius - 5; System . out, printn("Circle Point : X:" + p1.x + " Y:" + p1.y; System.out.println("Circle Radius:" radius); public Circle(Point p1){ radius- 5; System.out.println("Circle Point: X:" + p1.x + " Y:" + p1.y); System.out.println("Circle Radius:"+radius)Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
