• 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

super class implemnts the sub class method ??

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those guys from ExamLab make you scratch your head and spend all the night with rolling eyes and boiling head
I loved them , look at the code below " the idea is from ExamLab edited by me"

I know its ok for class A to be abstract without a single abstract method, but what is the concpet behind the other ideas?? thank you for elaborating on this.
[EDIT] ed many times for seek of clearness and spelling mistakes[EDIT]
 
Ranch Hand
Posts: 62
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hint is here:

It is strange but true that abstract class CAN inherit from concrete class.



Above code is VALID.

If you know the above concept, there is nothing strange in the actual output.
 
Imad Aydarooos
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear Hrishikesh Yeshwant Alshi , thanks for your reply, but this is not the cause of my confusion, please look at the code I posted and answer the following questions:
1- is go() in A is an implementation for abstract go() in B? " I guess the answer is no, but I need an explanation".
2- is go() in B is an overriding of go() in A ? " is it legal to inhert an implemented method and then abstract it, because I think this is what happened [explanation backed with quotes please] !!"
3- if the above is not true, why the (class Abstract) didn't inhert go() method from A?

Regards
 
Imad Aydarooos
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to all of you thanks Hrishikesh , but I find all the answers here
JLS Classes 8.4.3.1 abstract Methods

and a quote "An instance method that is not abstract can be overridden by an abstract method. " go to the above URL for more reading

Regards
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic