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
Unlock Smarter Learning with AskSia Super!
Join Super, our all-in-one AI solution that can greatly improve your learning efficiency.