abstract
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
how do we access a concrete method of an abstract class from a concrete class?
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Could you be more specific?
What relationship does the concrete class have to the abstract class?
What relationship does the concrete class have to the abstract class?
b reddy
Greenhorn
Posts: 7
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
suppose if there is an abstract class x. show() is a concrete method in x class.
y is a class which extends x.
how do we access show() of class x?
can we override methods that are in abstract classes?
y is a class which extends x.
how do we access show() of class x?
can we override methods that are in abstract classes?
Keith Lynn
Ranch Hand
Posts: 2412
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Yes you can override methods that are inherited from abstract classes as long as you obey the usual rules of overriding.
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
"breddy",
There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JavaRanch Sheriff
There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JavaRanch Sheriff
b reddy
Greenhorn
Posts: 7
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
can we create an object to an abstract class?
Keith Lynn
Ranch Hand
Posts: 2412
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
No, you can't create an instance of an abstract class with a constructor.
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Here is an eg. showing how to access / override / overload a concrete method that is declared in the abstract base class.
b reddy
Greenhorn
Posts: 7
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Keith,
can you tell me the difference between instance variable and an reference variable?
can you tell me the difference between instance variable and an reference variable?
b reddy
Greenhorn
Posts: 7
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi krishnan,
are you sure that a.supershow() will work?
i dont think so this will work.
are you sure that a.supershow() will work?
i dont think so this will work.
Meena R. Krishnan
Ranch Hand
Posts: 178
posted 18 years ago
why do you think so?
superShow() is a method in the extended class which in turn calls the super class' concrete method.
Here is the o/p from the above code.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
are you sure that a.supershow() will work?
i dont think so this will work.
why do you think so?
superShow() is a method in the extended class which in turn calls the super class' concrete method.
Here is the o/p from the above code.
| It looks like it's time for me to write you a reality check! Or maybe a tiny ad! Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |










