Question: QUESTION 5 Create a Java class called Pen with the following variables: String type, String make and int size. The class should have a default

QUESTION 5

Create a Java class called Pen with the following variables: String type, String make and int size. The class should have a default constructor and an overloaded constructor which accepts the three parameters: type, make and size. Create a class called UsePen with a main method(). In the main method do the following: Create an instance of class Pen p1 using the default constructor and populate the three variables with a type, make and size. Create an instance of class Pen p2 using the overloaded constructor, passing it three parameters for type, ,make and size. Show output for all constructors

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!