Created
November 15, 2018 09:04
-
-
Save canokay/a4d5bb80c4f4b0bb32fa6f7d866be68e to your computer and use it in GitHub Desktop.
Java Console Login Example
This file contains 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 JavaConsoleLogin { | |
public static void main(String[] args){ | |
Scanner input = new Scanner(System.in); | |
System.out.print("Kullanıcı Adı: "); | |
String username= input.nextLine(); | |
System.out.print("Şifre: "); | |
String password= input.nextLine(); | |
System.out.println("Kullanıcı adı: " + username); | |
System.out.println("Şifre: " + password); | |
if (username.equals(username)){ | |
if (password.equals("asd123")){ | |
System.out.println("Doğru giriş yaptı..."); | |
} | |
else{ | |
System.out.println("Şifre yanlış :("); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
input.close(); to end function main