Created
January 4, 2013 02:38
-
-
Save PatchRowcester/4449458 to your computer and use it in GitHub Desktop.
Accept a character and display it. Also, accept a string and look for two consecutive digits and display them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class FindWithinHorizon_Test { | |
public static void main(String args[]) { | |
Scanner myScanner = new Scanner(System.in); | |
char t,x; | |
t = myScanner.findWithinHorizon(".", 0).charAt(0); | |
System.out.println(t); | |
x = myScanner.findWithinHorizon(".", 0).charAt(0); | |
System.out.println(x); | |
String t1 = myScanner.findWithinHorizon("\\d\\d", 0); | |
System.out.println(t1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment