OOP Notes
Abstract Classes and Methods
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).
https://www.w3schools.com/java/java_abstract.asp
Interfaces
Another way to achieve abstraction in Java, is with interfaces.
An interface
is a completely "abstract class" that is used to group related methods with empty bodies:
Reference From
https://www.w3schools.com/java/java_interface.asp
PHP Namespaces
Namespaces are qualifiers that solve two different problems:
Array and Lists
Both are use for store data. But
Also lists are containers for elements having differing data types but arrays are used as containers for elements of the same data type.
Comments
Post a Comment