File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inheritance

 
Gaurav Pavan Kumar Jain
Ranch Hand
Posts: 168
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic