1234567891011121314151617181920212223242526272829303132 |
- import java.io.InputStream;
- import java.util.Scanner;
-
- public class Main {
- public static void main(String[] args) {
- if(login(System.in)) {
- System.out.println("Hello World");
- }
- }
-
- public static boolean login(InputStream in) {
- Scanner s = new Scanner(in);
-
-
- for (int i = 0; i < 3; i++) {
- System.out.print("Benutzername: ");
- String login = s.next();
- System.out.print("Passwort: ");
- String passwort = s.next();
-
- Credentials cred = new Credentials(login, passwort);
-
- if (cred.valid()) {
- return true;
- }
-
- System.out.println("Du kommst hier nicht rein");
- }
- s.close();
- return false;
- }
- }
|