Computers and Technology

2. 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 value. • A getter method that returns the int value. • The methods isEven(), isOdd(), and isPrime() that return true if the value in this object is even, odd, or prime, respectively. • The static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd, or prime, respectively. • The methods equals(int) and equals(MyInteger) that returns true if the value in this object is equal to the specified value. Write a client program that tests all the methods in the class.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:00, brookerebman15
Which type of tab stop is most for weights and measurements?
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, manlyman31
Selling a product through an electronic medium is
Answers: 1
image
Computers and Technology, 23.06.2019 06:20, kiarakagni
What is a point-in-time measurement of system performance?
Answers: 3
image
Computers and Technology, 23.06.2019 21:00, shyshy1791
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
Do you know the correct answer?
2. Design a class named MyInteger. The class contains : • An int data field named value that stores...

Questions in other subjects: