Object Oreinted Programming OOP
Object stores its state in fields(fields represent the object stats),and exposes its behavior through methods.and data encapsulation It can’t be accessed if it is private.
Uses:
- Object
- Class
- Public
- Private
- Protected
All of them depends on type of class.
- Inheritance
Using inheritance when i needed to access the parameter used in parent class but should have a public or protected data type and if it protected can’t used in the main.
Or Inheritance we use it when we creat class need same fields or same functions.extends , class MyClass extends MySuperClass
- Package
Package allow to keep HTML pages in one folder, images in another, and scripts or applications in yet another same the folder in computers.
- Interface
How to declare the Class
public class Read4{
public static void main(String[] args){
System.out.print("Ali Shiyyab");
}
}
-
Declaring Member Variables depends on the modifires type like public or private.
-
Overloaded can declear the method with same name but with deffirent arguments.
-
Constructors : can create one defult constructur without arguments.
-
Decimal Numbers : all digin in it has position and the decimal knows us which position.(Base 10)
-
Binary Numbers: Base 2start counting at 0, then 1, then you run out of digits.
-
Hexadecimal Numbers: Base 16 start from 0 to 9 then continue with A,B,C,…