Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package college;
- public class StudentAccount {
- // instance fields
- private String name;
- private int studentNumber;
- // constructor
- public StudentAccount (String a, int b ) { // made a method and defined a as string and b as int
- name = a; // used because we can't call the variable -
- studentNumber = b; // - arguments from inside the method, we are giving it a value
- }
- public String getName(){ return name; } // making a constructor for the name
- public int getStudentNumber () { return studentNumber; } // making a constructor for the student number
- // making a constructor so that it can be called
- } // return statment is used to return the information
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement