Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

simple login password and username java

import java.util.Scanner;

public class Sample {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter Username: ");
        String user = input.nextLine();
        System.out.print("Enter Password: ");
        String pass = input.nextLine();
        if (user.equalsIgnoreCase("jas") && pass.equals("1224")) {
            System.out.print("
Welcome! " + user);
        } else {
            System.out.print("You don't have access!");
        }
        input.close();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: 12 hours to 24 hours java 
Java :: changer version java terminal 
Java :: difference between access specifiers and access modifiers in java 
Java :: retrofit implementation 
Java :: mobile number validation to edittext in android 
Java :: intent flag clear task 
Java :: java string remove character 
Java :: arrays.tostring java 
Java :: play mp3 android java 
Java :: how to get input form combobox java 
Java :: java gridpane background color 
Java :: android recyclerview item click listener 
Java :: java remote debug 
Java :: how to print to the console in java 
Java :: build tools java 
Java :: dark mode app android studio 
Java :: java print array backwards 
Java :: java comments 
Java :: logical operators in java 
Java :: strictfp java 
Java :: joining an array of strings in java 
Java :: java check if file exists 
Java :: how to remove null values collections 
Java :: enum set in java 
Java :: datatypes in java 
Java :: check if list includes value java 
Java :: count occurrences of character in string java using hashmap 
Java :: java char array to string 
Java :: spring db properties 
Java :: simple function java 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =