Answer to Question #183602 in Java | JSP | JSF for Tim

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');


1
Expert's answer
2021-04-24T15:14:06-0400

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog