Question
Java programming Create a class titled Integer. Examples: AnnaInteger LarryInteger SueInteger Etc. This class is to contain: An int data field titled with your first
Java programming
Create a class titled Integer. Examples:
AnnaInteger
LarryInteger
SueInteger
Etc.
This class is to contain:
An int data field titled with your first name.
A constructor that takes and sets the initial value.
Getter and setter methods.
Non-Static methods titled isEven(), isOdd(), and isPrime() returning true or false based on the variables value.
Static methods with signatures isEven(int), isOdd(int), and isPrime(int) with the same basic logic as the previous methods with results based on the parameter.
Static methods with signatures isEven( Integer), isOdd( Integer), and isPrime( Integer) with the same basic logic as the previous methods with results based on the parameter.
The methods equals(int) and equals( Integer) which returns true if int values are equal and false if they are not.
Write test code that creates three instances, two with the same value, and one with a different value.
Write test code that ensures all methods function correctly.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started