I WANT TO CODES AND UML DIAGRAM
Design a class named MyInteger. The class contains:
Draw the UML diagram for the class. Implement the class. Write a client program that tests all methods in the class.
Draw the UML class diagram.
Solution :: I have implemented the code MyInteger and Main display the result as per the given description. PLEASE FIND THE FOLLOWING CODE SCREENSHOT/OUTPUT AND CODE ANY CLARIFICATIONS REQUIRED TO LEAVE A COMMENT CODE SCREENSHOT: 蛔 Main.java xx MyInteger.java xx ------------------------------------------------------------ OUTPUT: Output - Mylnteger (run)run:First MyInteger : 234IsEven : trueIsodd : falseIsPrime : falseSecond MyInteger : 233IsEven : falseIsOdd : trueIsPrime : trueBUILD SuCCESSFUL (total time: 1 second) CODE: Main.java public class Main { public static void main(String[] args) { MyInteger mi1=new MyInteger(234); MyInteger mi2=new MyInteger(233); System.out.println("First MyInteger : "+mi1.getData()); System.out.println("IsEven : "+mi1.isEven()); System.out.println("IsOdd : "+mi1.isOdd()); System.out.println("IsPrime : "+mi1.isOdd()); //testing the static method System.out.println("Second MyInteger : "+mi2.getData()); System.out.println("IsEven : "+MyInteger.isEven(mi2)); System.out.println("IsOdd : "+MyInteger.isOdd(mi2)); System.out.println("IsPrime : "+MyInteger.isOdd(mi2)); } } MyInteger.java public class MyInteger { private int data; public MyInteger(int data) { this.data = data; } public int getData() { return data; } public boolean isEven(){ return this.data%2== ... See the full answer