java class 5

Instructions

  • Create any class that you want, to demonstrate that you know how to create classes and objects.
  • Create fields and getter/setter methods(1 point)
    • Create at least 3 private fields (attributes/instance variables) for your class
    • You must use at least 3 different data types for your fields
  • Create getter and setter methods (1 point)
    • Create a getter (accessor) method for each of your instance variables
    • Create a setter (mutator) method for each of your instance variables
  • Create 2 methods (1 point)
    • Create a method called display, that simply prints out the values of all instance variables of your object
    • Create another method that will do something related to your object that changes at least one of your fields value
  • Create 2 Constructors (1 point)
    • Create a default constructor (no parameters) that assigns all your instance variables to default values
    • Create a parameterized constructor that takes all instance variables as parameters, and sets the instance variables to the values provided by the parameters
  • Testing your program (1 point)
    • Create another class called Demo.java. This class will contain your main method
    • Create an 2 instances of your class (objects) by using the default constructor.
      • Call all your objects set methods to assign values to your object
    • Create 2 instances of your class (objects) by using the parameterized constructor
  • Displaying output (1 point)
    • Put all 4 objects into an array or ArrayList, and then loop through the array and call the display() method for each one

 

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post java class 5 appeared first on My Nursing Experts.

 

“Are you looking for this answer? We can Help click Order Now”