Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a UML diagram based on the Java code linked to later on this page. There are two Java interfaces. These must be abstract classes

Create a UML diagram based on the Java code linked to later on this page.
There are two Java interfaces.
These must be "abstract classes" in UML notation (e.g.,, the class names need to be italicized).
ASIDE: If italics is not available or if hand-drawn then one must used the "{abstract}" classifier which must appear below the name of the class/interface that is abstract.
One of the Java interfaces is a generic interface so such must be shown as parameterized type.
All public, protected, and private methods must be properly indicated.
There are three Java classes.
All public, protected, and private properties and methods must be properly indicated.
With all of code, involved types must be indicated.
In UML types are always the name followed by a colon followed by the type.
e.g., "alpha : int" (without the quotes) would be a variable of type int called alpha
e.g., "foo(a : int, b : float) : string" would be a function called foo having two parameters a and b where a is an int, b is a float, and the function returns a string
the Java code is below:
GenericPoint2D.java
interface GenericPoint2D
{
public E getX();
public E getY();
}
GPoint2D.java
class GPoint2D implements GenericPoint2D
{
private E x;
private E y;
public E getX(){ return x; }
public E getY(){ return y; }
protected void setXY(E x, E y)
{
x = x;
y = y;
}
}
Point2D.java
class Point2D extends Point2DBase implements Point2DInterface
{
private boolean flag;
public double getX()
{
return super.x;
}
public double getY()
{
return super.y;
}
protected void setXY(double x, double y)
{
super.x = x;
super.y = y;
}
}
Point2DBase.java
class Point2DBase
{
protected double x;
protected double y;
}
Point2DInterface.java
interface Point2DInterface
{
public double getX();
public double getY();
}

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

More Books

Students also viewed these Databases questions

Question

6. Conclude with the same strength as in the introduction

Answered: 1 week ago

Question

7. Prepare an effective outline

Answered: 1 week ago