Given: And given the code fragment: What is the result?
A.
Compilation fails only at line n2
B.
Compilation fails at both line n1 and line n2
C.
Compilation fails only at line n1
D.
Null 0 Auto 4W 150 Manual
E.
4W 100 Auto 4W 150 Manual
Given: And given the code fragment: What is the result?
A.
Compilation fails only at line n2
B.
Compilation fails at both line n1 and line n2
C.
Compilation fails only at line n1
D.
Null 0 Auto 4W 150 Manual
E.
4W 100 Auto 4W 150 Manual
B
Answer is A because, this(trans) will call constructor, that should be first statement in the constructor
B
n1 = Implicit super constructor is undefined. (Must call “super(type, maxSpeed);”)
n2 = Constructor call must be first statement in constructor.
La puta, estas respuestas estan mal, la respuesta es B, debido a que si se usa super o this, estos deben de ser llamados siempre en la primera linea del constructor
Yes Kazuyuki, I get the same errors as you did in Eclipse. However TestKing says the answer is:
Null 0 Auto
4W 150 Manual
Which is wrong.
I put it in Eclipse…
It fails at //line 1 & //line 2
Error //line 1:
Super(….) is undefined. The super(….) has to be the first argument in an construkter of an subclass.
Error //line 2:
Constructor call must be first statement in an constructor.
This is not possible because the argument super(…) has to be the first argument too.
Correct is “B”
b
B
Correct Answer is C. I have tried it in Eclipse.
The correct answer is
B.Compilation fails at both line n1 and line n2
Compilation fails at both
line n1:There is not default constructor in class Vehicle
line n2:Call of the constructor must be the first statement.
Sir are any of these question seen on the exam?