This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inheritance" Watch "Inheritance" New topic
Author

Inheritance

Gaurav Pavan Kumar Jain
Ranch Hand

Joined: Mar 19, 2007
Posts: 168
class super {
2. public float getNum() {return 3.0f;}
3. )
4.
5. public class Sub extends Super {
6.
7. )
Which method, placed at line 6, will cause a compiler error?
A. Public float getNum() {return 4.0f; }
B. Public void getNum () { }
C. Public void getNum (double d) { }
D. Public double getNum (float d) {retrun 4.0f; }
Answer: B

cannot get the answer
dipayan chatterjee
Ranch Hand

Joined: Oct 03, 2007
Posts: 47
Hi gaurav

well this question is exactly the same as your previous query on inheritence only the wordings have changed,refer your previous query and try out this question once again, will get to know why B is correct. in case you fail i am there to help you


SCJP1.4 , gearing up for SCWCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inheritance