Data abstraction is the process of hiding certain details and showing only essential information to the user. Abstraction can be achieved with either abstract classes or interfaces which you will learn more about in the next chapter.
The abstract keyword is a non-access modifier, used for classes and methods: Abstract class: is a restricted class that cannot be used to create objects to access it, it must be inherited from another class. Abstract method: can only be used in an abstract class, and it does not have a body. The body is provided by the subclass inherited from. An abstract class can have both abstract and regular methods:.
Sign Out View Profile. Over 2 million developers have joined DZone. When to Use Abstract Class and Interface.
Learn when it would be more helpful to use an abstract class in Java rather than the interface. Like Join the DZone community and get the full member experience. Join For Free. Pulkit Sharma says:. July 30, at am. March 11, at am. Bhagyashri Chaudhari says:. March 2, at am. Frank says:. March 12, at pm. March 15, at pm. Deepak gupta says:. September 23, at pm. Kenneth says:. February 17, at pm.
Praveen says:. September 23, at am. VIJAY says:. February 6, at am. Morteza says:. September 16, at am. Alwin says:. September 14, at am. August 23, at am. May 12, at am. February 25, at am. March 6, at pm. Fravashi Kaustav says:.
February 10, at pm. Deepak Tiwari says:. June 2, at pm. James says:. August 26, at am. August 27, at am. Yoganathan says:. June 19, at pm. June 20, at am. Siva says:. August 18, at am. Stanley says:. June 15, at pm. June 16, at am. Latest Insider. Check out the latest Insider stories here. More from the IDG Network. How to implement a simple logger in C. Singleton vs. How to use default interface methods in C 8.
0コメント