abstract class A
{
abstract void callme();
void callmetoo()
{
System.out.println("this is concrete method");
}
}
class B extends A
{
void callme()
{
System.out.println("implementation of callme");
}
}
public class abstractdemo {
public static void main(String []args)
{
B b=new B();
b.callme();
b.callmetoo();
}
}
fsl4faisal -4 Newbie Poster
Recommended Answers
Jump to PostThey're a tool to allow giving a class you define a type.
Jump to PostYes, there are many ways to do things. Some better than others
Jump to PostWell, here's a quick answer for the difference b/w abstract classes and interfaces :
Abstract classes can contain both abstract as well as non-abstract(concrete) methods.
Interfaces can only contain abstract methods. NO non-abstract (concrete) methods are allowed inside an interface. In other words, interfaces are 100% abstract classes.
…
All 11 Replies
fsl4faisal -4 Newbie Poster
NormR1 563 Posting Sage Team Colleague
fsl4faisal -4 Newbie Poster
NormR1 563 Posting Sage Team Colleague
fsl4faisal -4 Newbie Poster
NormR1 563 Posting Sage Team Colleague
fsl4faisal -4 Newbie Poster
NormR1 563 Posting Sage Team Colleague
fsl4faisal -4 Newbie Poster
NormR1 563 Posting Sage Team Colleague
NP-complete 42 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.