Question #183602

*Based on answer choices A-E, what is the correct option?


4. Given the following code, which is the correct way to create an object using the

parameterized constructor?


class Elmo

{

int age;

double length;

char model;

Elmo(int a, double l, char m) { age = a; length = l; model = m; }

}


A. Elmo e1 = new Elmo('Y', 5.6, 7);

B. Elmo e1 = new Elmo(5.6, 'Y', 7);

C. Elmo e1 = new Elmo(7, 'Y', 5.6);

D. Elmo e1 = new Elmo(5.6, 7, 'Y');

E. Elmo e1 = new Elmo(7, 5.6, 'Y');


Expert's answer

E. Elmo e1 = new Elmo(7, 5.6, 'Y');


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS