This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training 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 Quetions abt Overriding a Method in a Concrete 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 "Quetions abt Overriding a Method in a Concrete Class" Watch "Quetions abt Overriding a Method in a Concrete Class" New topic
Author

Quetions abt Overriding a Method in a Concrete Class

Harry D'Souza
Greenhorn

Joined: Dec 28, 2002
Posts: 28
Hi,
I have a question. I know it is simple but somehow it just does not strike to me. I guess I am too stressed out
I have an abstract class that has two methods - one declared abstract [i.e Method1()] and the other that is defined [Method2()]. In my Concrete Class, I have defined Method1() and want to override Method2().I wish to override Method2() as I would like to extend the functionality of this method which was already defined.
My question is: While overriding the Method2() how do I call the Method2() of the Abstract Class?

The code for the above scenario Could be like this :
The code for the Abstract Class : AbstractClass.java

The code for the Concrete Class : ConcClass.java

[ April 26, 2003: Message edited by: Harry D'Souza ]

Harry D'Souza<br />SJCP 1.4 , SCWCD
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
super.Method2(); should do the trick.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Harry D'Souza
Greenhorn

Joined: Dec 28, 2002
Posts: 28
Roger,
It sure does. I feel so bad that it did not strike me. As I said I knew it was easy but ..
Thanks for your reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Quetions abt Overriding a Method in a Concrete Class