import static java.lang.System.
*
; public class OddOrEven
{
private int number; public OddOrEven
(
)
{
}
public OddOrEven
(
int num
)
(
number
=
num;
}
public void setNum
(
int num
)
(
number
=
num;
}
public boolean isOdd
(
)
{
return number
%
2
!
=
0
;
}
public String toString
(
)
{
if
(
isOdd
(
)
)
{
return number
+
"
is odd.
"
;
}
else
{
return number
+
"
is even.";
}
}
}
Not the question you are looking for? Ask here!
Enter question by text
Enter question by image
Upgrade to Asksia Pro
Join a AskSia's Pro Plan, and get 24/7 AI tutoring for your reviews, assignments, quizzes and exam preps.