Advertisement
Nader_00

CommercialClient Class

Feb 16th, 2020
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package Bank;
  2.  
  3. public class CommercialClient extends Client {
  4. private String Commercial_Id;
  5.  
  6. public CommercialClient() {
  7. this.Commercial_Id = "00000000000000";
  8. Set_Nationalid("00000000000000");
  9. }
  10. public CommercialClient(String Commercial_Id, String Phone_num, String Address, String Name) {
  11. this.Commercial_Id = Commercial_Id;
  12. Set_Nationalid("00000000000000");
  13. Set_Address(Address);
  14. Set_Name(Name);
  15. Set_Phone(Phone_num);
  16. }
  17. //Set & Get the Commercial_Id attribute.
  18. public void Set_Commercialid(String Commercial_Id) {
  19. this.Commercial_Id = Commercial_Id;
  20. }
  21. public String Get_Commercialid() {
  22. return Commercial_Id;
  23. }
  24. ///Override the method toString to make it print the whole information of the class
  25. @Override
  26. public String toString() {
  27.  
  28. return String.format("The Commertial id of the Company is: " + Get_Commercialid() + "\n"
  29. +"The national id of the Company is: " + Get_Nationalid() + "\n"
  30. +"The name of the client is: " + Get_Name() + "\n"
  31. +"The phone number of the Company is: " + Get_Phone() + "\n"
  32. +"The Address of the Company is: " + Get_Address() + "\n");
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement