Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 48 49 } 500 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. String color ="055255200"; int lifetime = 2; String type = "pencil"; String brand = "Staedtler

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

If you were the President how would you handle this problem?

Answered: 1 week ago

Question

5-32. It would appear that someone apparently entered illegally.

Answered: 1 week ago