Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  email
Language: JAVA
Code:
package f;

import java.util.Scanner;

public class Test1 {

  String user_name = "fr1995";
  String password = "1234";
  Scanner input = new Scanner(System.in);

  public void loginToMail() {
    System.out.println("enter user name");
    String u = input.next();
    System.out.println("enter pass");
    String p = input.next();
    if (u.equals(user_name) && p.equals(password))
      System.out.println("Log in");
    else
      System.out.println("Error");
  }

  public static void main(String[] args) {
    Test1 t = new Test1();
    t.loginToMail();

  }

}
Comments: