Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Scanner;
- public class AccountData {
- ArrayList<AccountData> accountList = new ArrayList<AccountData>();
- Scanner myScan = new Scanner(System.in);
- // variables
- String firstName;
- String lastName;
- String address;
- int pin = 0;
- int balance = 0;
- public AccountData() {
- }
- // set
- public void setFirstName(String first) {
- firstName = first;
- }
- public void setLastName(String last) {
- lastName = last;
- }
- public void setAddress(String addr) {
- address = addr;
- }
- // this should eventually be changed to a PIN generator
- public void setPin(int pin) {
- System.out.println("Desired PIN");
- pin = myScan.nextInt();
- }
- // get
- public void getFirstName() {
- System.out.println("First name: " + firstName);
- }
- public void getLastName() {
- System.out.println("Last name: " + lastName);
- }
- public void getAddress() {
- System.out.println("Address: " + address);
- }
- public void getArrayList() {
- System.out.println(accountList);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement