Java Program to Create Login Page

preview_player
Показать описание
#BackCoding

Antony and his friends plan to create an application. They decide to create a login page. Users need to register their details and login before using the application.

They need to create a login page where only the registered user can login Create a Java program to help them create a simple model for their application by getting registration details, storing them and verifying the login process.

#programming
#shorts
#java
#dcoder
Рекомендации по теме
Комментарии
Автор

import java.util.Scanner;


class Login{
Scanner sc;

String ur, pass;

public Login(Scanner sc){
this.sc=sc;
insertData();
}
public void insertData(){
System.out.println("Enter Username:");
ur=sc.nextLine();

System.out.println("Enter Password:");
pass=sc.nextLine();
validation();
}
public void validation(){
if(ur.equals("admin")){
if(pass.equals("admin")){
Login welcome user");

}else{
System.out.println("Wrong Password please try again ");

}
}else{
System.out.println("Wrong Username please try again ");
}
}
}

class Login_Test{

public static void main (String as[]){
Scanner sc=new Scanner (System.in);
Login l=new Login(sc);
}
}

BackCoding
Автор

Which App you are using for coding and which screen recorder is used for making short videos.

arvindkumar
Автор

Is there a way to make the user and pass inputs save even after you exit out the script?

Captenprice
Автор

now plz tell me how to connect this with our html page

usomeshwaran
Автор

import java.util.Scanner;

class login{
Scanner scan = new Scanner(System.in);
String pass;
String user;

public void Sys(){
System.out.println("Input User: ");
user = scan.nextLine();

System.out.println("Input Password: ");
pass = scan.nextLine();
validate();
}

public void validate(){
if((user.equals("admin") ) && (pass.equals("admin"))){
Logged In");
} else {
System.out.println("Wrong user or pass");
}
}

}

public class Main {
public static void main(String[] args) {
login lg = new login();
lg.Sys();
}
}

much shorter

atomicbomblauncher