Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.util.HashMap;
- import java.util.Scanner;
- import java.io.*;
- public class Assignment5
- {
- public static void main(String[] args) throws IOException
- {
- HashMap<Integer,String> users = new HashMap<Integer,String>();
- String username;
- String password;
- Scanner keyboard = new Scanner(System.in);
- System.out.print("Enter filename: ");
- String filename = keyboard.nextLine();
- File file = new File(filename);
- Scanner inputFile = new Scanner(file);
- while(inputFile.hasNext())
- {
- id = Integer.parseInt(inputFile.Next());
- name = inputFile.nextLine();
- users.put(username, password);
- }
- inputFile.close();
- System.out.println("Login: ");
- username = keyboard.next();
- System.out.println("Password: ");
- password = keyboard.next();
- }
- }
Add Comment
Please, Sign In to add comment