Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java please 2. Create class MyInteger and a testing class that test every single method in the class -value: int An int value for

image text in transcribed

in java please

2. Create class MyInteger and a testing class that test every single method in the class -value: int An int value for the object. +MyInteger value: int) +get Value0: int +isPrime(): boolean +isPrime(value: int): boolean +isPrime(value: MyInteger): boolean +isEven): boolcan +isEven(valuc: int): boolcan +isEven(value: Mylnteger): boolean +isOddO: boolean +isOdd (value: int): boolean tisOdd(value: Mylnteger): boolean +equals(anotherValue: int): boolean +equals(anotherValue: Myln teger): boolean Constructs a Myinteger object with the specified int value. Returns the value in this object. Returns true if the value in this object is prime. Returns true if a specified int value is prime. Returns true if the value in a specified Myinteger object is prime. Returns true if the value in this object is even. Rcturns true if a specified int value is even Returns true if the value in a specified MyInteger object is even. Returns true if the value in this object is odd. Returns true if a specified int value is odd. Returns true if the value in a specified Mylnteger object is odd. Returns true if a specified int value is equal to the value in this object Returns true if the value in a specified Mylnteger object is equal to the value in this object. Returns the int valuc for the specified string. +parselnt(value: String): int 3. Create class MyRectangle2D and a testing class that tests every single method -x: doublc y: double -width: double -height: double + MyRectangle2DO +MyRectangle2D(x: double, y: double, width: double,height: double +getXO: double +setX(x: double): void tgetYO:double setY(y: double): void get Width0: double + set Width(width: double): void tgetHeightO: double +setHeight(height: double): void + getRadius): double t getPerimeter): double getArea): double +contains( x: double, y: double): boolean +contains(r: Rectangle2D): Boolean Return true if the specified point is in the rectangle Returns true if Rectanble2D object is inside rectangle of this object Returns true if Rectanble2D object overlaps with rectangle of this object toverlaps(r: Rectangle2D); boolean

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions