• 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

Sierra Bates Book CH2 Q7

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Answer:

class AgedP {
AgedP() {};
public AgedP(int x) {
}
}

public class Kinder extends AgedP {
public Kinder(int x) {
}
}

Is different from the published one, however it still compiles? (In Eclipse jdk 1.6) Is the super(); call really necessary?
if not why does it compile?

gone through the book once and going through all the questions fresh b4 taking a mock! (Finding I tend to stumble on sneaky things too!!!)
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
Take an extra look at Q7.
"();" are already in Kinder(int x), you can't remove them.
Regards,
Teo

[ October 15, 2007: Message edited by: Teo Framoe ]
[ October 15, 2007: Message edited by: Teo Framoe ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It compiles because Compiler adds super(); for you.
you don't need to write extra super(); call. I believe that the question is wrong.
 
Erhan BAGDEMIR
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah ! i saw that omg ! `();�
 
Robert Elbourn
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ahhhhh flip!!!

thanks for spotting that, was a little too near the crease for me to see.

I often get caught out by the smallest of details!!! this is gonna be hard :-
 
Robert Elbourn
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I went to the tea machine looking for tea and selected coffee

this does not bode well because:

1) It was multiple choice
2) It wasn't trying to disguise the options
3) I knew what I wanted and what the correct answer was
4) I selected the wrong one

The SJCP exam is :

1) Multiple Choice
2) DOES try to disguise the right answer
3) Even if I do know what the right answer is ....

anyway
 
reply
    Bookmark Topic Watch Topic
  • New Topic