Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Bank;
- public class Client {
- private String Name;
- private String National_Id;
- private String Address;
- private String Phone_num;
- /// Account object.
- public Client() {
- ///Initial Value.
- this.Name = "No Name.";
- this.Address = "No Address.";
- this.National_Id = "00000000000000";
- this.Phone_num = "00000000000000";
- }
- public Client(String Name, String National_Td, String Address, String Phone_num) {
- ///parameterised constructor to initial the values.
- this.Name = Name;
- this.Address = Address;
- this.National_Id = National_Td;
- this.Phone_num = Phone_num;
- }
- //Set & Get the Name attribute.
- public void Set_Name(String Name) {
- this.Name = Name;
- }
- public String Get_Name() {
- return Name;
- }
- //Set & Get the National Id attribute.
- public void Set_Nationalid(String National_Id) {
- this.National_Id = National_Id;
- }
- public String Get_Nationalid() {
- return National_Id;
- }
- //Set & Get the Address attribute.
- public void Set_Address(String Address) {
- this.Address = Address;
- }
- public String Get_Address() {
- return Address;
- }
- //Set & Get the Phone attribute
- public void Set_Phone(String Phone_num) {
- this.Phone_num = Phone_num;
- }
- public String Get_Phone() {
- return Phone_num;
- }
- ///Override the method toString to make it print the whole information of the class
- @Override
- public String toString() {
- return String.format("The name of the Client is: " + this.Get_Name() + "\n" +
- "The address of the Client is: " + this.Get_Address() + "\n" +
- "The National Id of the Client is: " + this.Get_Nationalid() + "\n" +
- "The Phone number of the Client is: " + this.Get_Phone() + "\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement