Forums Register Login

I think it should be false.

+Pie Number of slices to send: Send
This question was posted in the other disc.. group.
Constructor invokation occurs from the current class up the hierarchy to the ancestor class.Is this true.
Any comments.
+Pie Number of slices to send: Send
I'd say it's true. If you have
class A {}
class B extends A {}
class C extends B {}
then the constructor for C invokes the constructor for B, which in turn invokes the constructor for A. That's how I interpret the question anyway. Why do you think it should be false?
+Pie Number of slices to send: Send
Hey Jim,I think the other guy must have been posted this question from Marcus Mock Exam 3.
Now when iam going through Marcus Mock Exam 3 i saw this question and the answer given was false.Question 43)
Which of the following statements are true
1) constructors cannot be overloaded
2) constructors cannot be overriden
3) a constructor can return a primitive or an object reference
4) Constructor invokation occurs from the current class up the hierarchy to the ancestor class

---Answer to Question 43)
2) constructors cannot be overriden
4) constructors must have the same name as the class they "construct"
Overloading constructors is a key technique to allow multiple ways of initialising classes. By definition constructors have no return values so option 3 makes no sense
http://www.software.u-net.com/javaexam/exam3.htm
+Pie Number of slices to send: Send
Sorry, Jim its given as true.
I could not see it.(May be iam sleepy).
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 835 times.
Similar Threads
Marcus mock 3 No.43
constructors??
Marcus Green's exam 3, Q43
Marcus Green's Mock 3 Q43.
About MarcusGreen Test 3 Question43
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:18:23.