{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

StringOddOrEven - word=s public boolean isEven...

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.*; import java.util.Scanner; public class StringOddOrEven { private String word; public StringOddOrEven() { word=""; } public StringOddOrEven(String s) { word=s; } public void setString(String s)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { word=s; } public boolean isEven() { if (word.length()%2==0) return true; return false; } public String toString() { String output=""; if(isEven()==true) return word+" is even.\n"; return word+" is odd.\n"; //return output; } }...
View Full Document

{[ snackBarMessage ]}