Question

(Java) Please describe how API's can be created using abstract classes, interfaces and regular classes.

(Java) Please describe how API's can be created using abstract classes, interfaces and regular classes.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

THANK YOU FOR YOUR QUESTION.

QUESTION :-

(Java) Please describe how API's can be created using abstract classes, interfaces and regular classes.

ANSWER :-

Regular Classes: Regular classes only have concrete methods. But regular classes cannot have abstract method. Understand and take only the concrete method and understand the upper abstract class.

For an example :-

example : public class Student{}

Interfaces: Interfaces have method declaration. And would not have method implementation. All the methods in interfaces are public abstract (default). A few class has to inherit the interface and state and describe the implementation of the method.

For an example : Interface Car { void PrintColor();

void PrintNumberOfGears();}

Public class BlackCar implements Car { public void PrintColor()

{System.out.println("Color is Black");}

public void PrintNumberOfGears()

{System.out.println("Number of Gears are 5");} }

Abstract Class: Abstract Methods are related or much similar to normal classes. And it can have abstract over and above concrete methods. Abstract methods must be inherited and defined.

example : public abstract class Students { public void PrintMarks()

{System.out.println("Printing Marks");} //concrete method

public abstract void PrintEmpId { } //abstract method

} //please note the abstract keyword

Important note : APIs are also methods. Therefore all of the over and above explaining descriptions are great and useful for creating APIs.

(PLEASE.. PLEASE.. PLEASE DO GIVE A THUMBS UP. HELP ME BUY A COFFEE IN QUARANTINE . And if you have any query than please comment I will help you . Thank you )

Add a comment
Know the answer?
Add Answer to:
(Java) Please describe how API's can be created using abstract classes, interfaces and regular classes.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT