JAVA Design a class named MyInteger . The class contains: An int data field named value that stores the int value represented by this object. A constructor that creates a MyInteger object for the...



JAVA


Design a class named
MyInteger. The class contains:



  • An int data field named
    value
    that stores the int value represented by this object.

  • A constructor that creates a
    MyInteger

    object for the specified int

  • A get method that returns the int

  • Methods
    isEven()
    ,
    isOdd()
    ,
    and
    isPrime()

    that return true if the value is even, odd, or prime, respectively.

  • Static methods
    isEven(int),isOdd(int),
    and
    isPrime(int)

    that return true if the specified value is even, odd, or prime, respectively.

  • Method
    equals(int)
    that return true if the value in the object is equal to the specified value.



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here