This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes abstract class extends abstract class! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "abstract class extends abstract class!" Watch "abstract class extends abstract class!" New topic
Author

abstract class extends abstract class!

Jyoti Vaskar
Ranch Hand

Joined: Jun 30, 2009
Posts: 142

what if an abstract class extends abstract class???
Has it to inherit all the methods of it's abstact super class??

Kindly explain.


thanks
Jyo
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Not required because you are declaring the child class itself as abstract.


Swastik
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Has it to inherit all the methods of it's abstact super class??


They are automatically inherited. You will have to implement the abstract methods that are inherited


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Dejan Miler
Ranch Hand

Joined: Nov 14, 2009
Posts: 56
Here is the example



1.The abstract class Dog can but do not need to implement astract makeASound method from his superclass Animal
2.The regular class Rottweiler must implements all abstract methods form his super class/classes (Animal class and Dog class).

Dejan.




SCJP 1.6 in progress ....
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

System.out.println("Auuuuuuuuu");


What kind of a dog says Auuuuuuuuu ? Is he hurt ?

Haresh Panjwani
Greenhorn

Joined: Nov 26, 2009
Posts: 1
All the methods of the abstract super class are inherited and you only need to implement those inherited methods
Dejan Miler
Ranch Hand

Joined: Nov 14, 2009
Posts: 56
My dog yowl like a wolf .
It is good thing to keep me awake at night to lean for SCJP.

Dejan
Santiago Ennis
Greenhorn

Joined: Nov 05, 2009
Posts: 9
Here, the concrete class Rottweiler does not need to implement makeASound(), as it was already implemented by its direct superclass Dog. But it is mandatory for Rottweiler class to implement command() method.




My first post, btw.


- SE
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10426
    
    8

Welcome to the Ranch Santiago


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Dejan Miler
Ranch Hand

Joined: Nov 14, 2009
Posts: 56
Welcome Ranch Santiago.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Welcome to javaranch, Haresh and Santiago
Jyoti Vaskar
Ranch Hand

Joined: Jun 30, 2009
Posts: 142
thank you everybody for replying on my post.

Also welcome Haresh & Santiago.
You both started from my post .
 
GeeCON Prague 2014
 
subject: abstract class extends abstract class!