Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created September 19, 2013 21:04
Show Gist options
  • Save bjhaid/6629800 to your computer and use it in GitHub Desktop.
Save bjhaid/6629800 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
import java.lang.Integer;
public class Test {
public static void main (String args[]) {
Scanner input = new Scanner(System.in);
while(true) {
Integer myint = readWord(input);
if (myint != 100) break;
System.out.println("Entered word is: " + myint);
}
}
public static int readWord(Scanner scanner) {
Scanner input = scanner;
System.out.print("Enter word to search for: ");
int inputword = new Integer(input.next());
System.out.println("Searching for word "+ inputword+ "...");
return inputword;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment