0% found this document useful (0 votes)
59 views1 page

3 Java Login System Example

This document provides a simple Java login system example using a console application. It prompts the user for a username and password, then checks the input against predefined credentials. If the input matches, it displays a success message; otherwise, it indicates invalid credentials.

Uploaded by

gta.v.yt11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views1 page

3 Java Login System Example

This document provides a simple Java login system example using a console application. It prompts the user for a username and password, then checks the input against predefined credentials. If the input matches, it displays a success message; otherwise, it indicates invalid credentials.

Uploaded by

gta.v.yt11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Java login system example

Simple Java Login System Example:

```java
import java.util.Scanner;
public class LoginSystem {
public static void main(String[] args) {
String username = "admin";
String password = "1234";
Scanner scanner = new Scanner(System.in);
System.out.print("Enter username: ");
String user = scanner.nextLine();
System.out.print("Enter password: ");
String pass = scanner.nextLine();
if(user.equals(username) && pass.equals(password)) {
System.out.println("Login Successful!");
} else {
System.out.println("Invalid Credentials.");
}
}
}
```

You might also like