
- Forum
- Programming Talk
- Java
- Abstract classes
Abstract classes
This is a discussion on Abstract classes within the Java forums, part of the Programming Talk category; Can we call a concrete method of an abstract class, without inheriting the abstract class? If yes, then how?...
-
Abstract classes
Can we call a concrete method of an abstract class, without inheriting the abstract class? If yes, then how?
-
Hi,
As per my knlowledge, we can't instantiate abstract classes directly, we must inherit the abstract classes. i mean we can't access a concrete method of an abstract class without inheriting the abstract class
-
06-04-2007, 02:19 PM #3
- Join Date
- May 2007
- Answers
- 2
In order to access methods of an abstract class we need to extend the class first
Thanks
Rammy
-
11-29-2007, 01:32 PM #4
- Join Date
- Nov 2007
- Answers
- 1
By declaring the methods as static., you can access the methods by using the class name without reference.
-
Joseph you are correct, by declaring the method as static we can access a concrete method of abstract class.
-
No we cant call without intilizing
-
09-30-2008, 02:56 PM #7
- Join Date
- Sep 2008
- Answers
- 2
Yes but only static method in abstract class
You can define static method in abstract class that method do not need any object for this class while calling.
abstract class MyOne
{
public static void show()
{
System.out.println("Abstract show");
}
}
public class ShowMain
{
public static void main(String[] args)
{
MyOne.show();
}
}
-
We cannt create an object of an Abstract class..
-
07-02-2010, 05:33 AM #9
- Join Date
- Jul 2010
- Answers
- 7
-
"yes,ssprastogi is right.we can do it.thanx i was not knowing it"
-
Sponsored Ads

Reply With Quote






