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 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 lifeTime; 39 String type; 40 String brand; 41- public Pen (String rgbcolor, String type, String brand) { 42 43 44 45 } 46 public Pen (String rgbcolor, int lifetime, String type, String brand) { 47 mmm 00 01 0 48 51 49 } 50- public Pen (Pen p) { 52 } 53 154 } 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 brand = "Staedtler
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
