Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. package project;
  2.  
  3. // Telecommunication Class
  4. public class TelecommunicationServiceProviders {
  5. //Declaration of attributes
  6. private int companyId;
  7. private String address;
  8. //Declaration and initialization of static attribute
  9. private static int customerAmount;
  10.  
  11. // Default Constructor
  12. public TelecommunicationServiceProviders() // Default Constructor
  13. {
  14. companyId=0;
  15. address="";
  16. customerAmount=0;
  17. }
  18.  
  19. // Primary Constructor
  20. public TelecommunicationServiceProviders( int cID, String add, int amount)
  21. {
  22. companyId= cID;
  23. address= add;
  24. customerAmount= amount;
  25. }
  26.  
  27. //Getters for Attributes
  28. public int getCompanyId() {
  29. return companyId;
  30. }
  31. public String getAddress() {
  32. return address;
  33. }
  34. public int getCustomerAmount() {
  35. return customerAmount;
  36. }
  37.  
  38. //Setters for attributes
  39. public void setCompanyId(int cID) {
  40. companyId = cID;
  41. }
  42. public void setAddress(String add) {
  43. address = add;
  44. }
  45. public void setCustomerAmount(int amt) {
  46. customerAmount = amt;
  47. }
  48.  
  49. public TelecommunicationServiceProviders(TelecommunicationServiceProviders TelecommunicationServiceProviders)
  50. {
  51. companyId= TelecommunicationServiceProviders.getCompanyId();
  52. address= TelecommunicationServiceProviders.getAddress();
  53. customerAmount= TelecommunicationServiceProviders.getCustomerAmount();
  54.  
  55. }
  56. public void Display ()
  57. {
  58. System.out.println("The Company ID is "+ getCompanyId() +"\n Addresss" + getAddress() +" \n\n Customer total is"+getCustomerAmount());
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement