Question: A class called Pen is defined, for which we require three constructors. Your job is to write A) the code for the first constructor (line

 A class called Pen is defined, for which we require three

constructors. Your job is to write A) the code for the first

A class called Pen is defined, for which we require three constructors. Your job is to write A) the code for the first constructor (line 42-44). B) the code for the second constructor (line 47-48) C) the code for the third constructor (line 51) 136 class Pen { 37 String rgbColor; 38 int life Time; 39 String type; 140 String brand; 410 public Pen (String rgbColor, String type, String brand) { 42 43 44 45 } 46 public Pen (String rgbColor, int lifeTime, String type, String brand) 47 48 49 } 50 public Pen (Pen p) { 51 52 } 53 54 } D) Now, assume that the four variables below are given. Instantiate two objects of Pen called obj1 and obj2, using two different constructors above. D) Now, assume that the four variables below are given. Instantiate two objects of Pen called obj1 and obj2, using two different constructors above. String color ="055255200"; int lifetime 2; String type = "pencil"; String brand = "Staedtler"; 1 A B 1 U S X2 x

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!