Notes 23-11-2022

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

23/11/2022

Overloading example

Login(String Username, String password){


}

Login(String Corporateid, String Username, String password ){


}

Overloading is Done :
1. when the number of parameter are different

2. when the data type of the parameter


print(integer num1, integer num2);
print(decimal num1, integer num2);

3. when the sequence of the parameter are different


print(integer num1, decimal num2);
print(decimal num1, integer num2);

Encapsulation --> Data hiding

Abstraction---> Implementation hiding --- hiding the functions


-- abstract class --> it provides partial abstraction
-- Interface --> it provides Full abstraction

abstract class A
{
public abstract void print(); <---- function declaration

public void message(){

}
}

exercise:-

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/
apex_classes_properties.htm

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/
apex_classes_extending.htm

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/
apex_classes_interfaces.htm

You might also like