Question: Create java project Create a java class Client Member methods and variables private fields: int ID, int port, String Name Constructors: Client() Client (int id)

  1. Create java project
  2. Create a java class Client
    1. Member methods and variables
      1. private fields:
        1. int ID,
        2. int port,
        3. String Name
      2. Constructors:
        1. Client()
        2. Client (int id)
        3. Client (int id, int p)
        4. Client (int id, int p, String n)
      3. public methods to access private fields:
        1. getPort()
        2. setPort()
        3. getID()
        4. setID()
        5. getName()
        6. setName()
      4. Public method to printout todays date: PrintDate()
  3. Create Child class of Client PrintClient
    1. add a field and get/set method to access it:
      1. String Location;
    2. Overload method PrintDate()

When Location is null or empty, call the parents method PrintDate(), or else, print Location information and no printDate can be viewed

  1. Create class of testClient
    1. build main method to test the classes you defined before
      1. build an object of class PrintClient named pc
      2. call the method PrintDate in PrintClient
      3. set the value of field Location to Classroom
      4. recall the method PrintDate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!