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).
Reference 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:

They allow for better organization by grouping classes that work together to perform a task
They allow the same name to be used for more than one class

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

Popular posts from this blog

Laravel Notes By Ahmed Awan

PHP Notes