{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

OddOrEven - number=num public boolean isOdd if(number%2==1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//© A+ Computer Science - www.apluscompsci.com //Name - //Date - //Lab - import static java.lang.System.*; public class OddOrEven { private int number; public OddOrEven() { number=0; } public OddOrEven(int num) { setNum(num); } public void setNum(int num)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { number=num; } public boolean isOdd( ) { if (number%2==1) return true; return false; } public String toString() { if(isOdd()==true) return number+" is odd.\n"; return number+" is even.\n"; } }...
View Full Document

{[ snackBarMessage ]}