• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I think it should be false.

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Roll
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Roll
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, Jim its given as true.
I could not see it.(May be iam sleepy).
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic