Escolar Documentos
Profissional Documentos
Cultura Documentos
1. Class name every word first letter should be capital. (First Class)
2. Method name first letter should be lower case there after every word first letter should be
upper case. (hello World)
3. For inputting the values, we need to use a method called set Values.
4. For output purpose we need to use a method called get Values.
5. NOTE: For writing the program we have to follow some Hungarian/camel notation.
6. Whenever we are using constants in our program that should be declared as capital letters.
7. Variable names/ Data member names should be in small letter’s.
Like JVM in Java, In apex we have an ARE (Apex Run Time Engine) is a Software program which takes the
responsibility to executive the APEX program the movement we click on run test method ARE looking for
a keyword called testmethod in the program from there its starts the execution.
We cannot write test method within the business class, it must be in test class only.
1) WRITE AN APEX CLASS INPUT EMPLOYEE NO. EMPLOYEE NAME EMPLOYYE BASIC
SALRY, HRA, DA, PF&TAX CALCULATE GROSS SALARY AND NET SALARY.
{
Ns=gs-(pf=tax);
}
}
@isTest
Obj.setValues(101,’reth’,20000,5000,2000,1000,500);
Obj.gross_sal();
Obj.net_sal();
Obj.getvalues();
}
write an apex class input customer account number, customer name, account balance.
Calculate total balance based on the transaction (i.e. that is deposit or withdraw)
local variable- with in the method
object variable-
//data member
Integer ac_no;
string ach_name;
interger ac_bal;
//member method;
1.create
Ac_no=0;
Ach_name=’no name’;
Ac_bal=0;
Count++;
Public bank account (integer no, string name, integer bal) // parameterized constructor
Ac_no=no;
Ach_name = name;
Ac_bal =bal;
Ac_no =no;
Ach_name= name;
Ac_bal =bal;
Count++;
System.debug(‘name’ + ach_name);
//process
//deposits
Ac_bal=ac_bal+amt;
//withdraw
Ac_bal