Advertisement
Nader_00

Client class

Feb 16th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. package Bank;
  2.  
  3. public class Client {
  4. private String Name;
  5. private String National_Id;
  6. private String Address;
  7. private String Phone_num;
  8. /// Account object.
  9.  
  10. public Client() {
  11. ///Initial Value.
  12. this.Name = "No Name.";
  13. this.Address = "No Address.";
  14. this.National_Id = "00000000000000";
  15. this.Phone_num = "00000000000000";
  16. }
  17. public Client(String Name, String National_Td, String Address, String Phone_num) {
  18. ///parameterised constructor to initial the values.
  19. this.Name = Name;
  20. this.Address = Address;
  21. this.National_Id = National_Td;
  22. this.Phone_num = Phone_num;
  23. }
  24. //Set & Get the Name attribute.
  25. public void Set_Name(String Name) {
  26. this.Name = Name;
  27. }
  28. public String Get_Name() {
  29. return Name;
  30. }
  31. //Set & Get the National Id attribute.
  32. public void Set_Nationalid(String National_Id) {
  33. this.National_Id = National_Id;
  34. }
  35. public String Get_Nationalid() {
  36. return National_Id;
  37. }
  38. //Set & Get the Address attribute.
  39. public void Set_Address(String Address) {
  40. this.Address = Address;
  41. }
  42. public String Get_Address() {
  43. return Address;
  44. }
  45. //Set & Get the Phone attribute
  46. public void Set_Phone(String Phone_num) {
  47. this.Phone_num = Phone_num;
  48. }
  49. public String Get_Phone() {
  50. return Phone_num;
  51. }
  52. ///Override the method toString to make it print the whole information of the class
  53. @Override
  54. public String toString() {
  55. return String.format("The name of the Client is: " + this.Get_Name() + "\n" +
  56. "The address of the Client is: " + this.Get_Address() + "\n" +
  57. "The National Id of the Client is: " + this.Get_Nationalid() + "\n" +
  58. "The Phone number of the Client is: " + this.Get_Phone() + "\n");
  59. }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement