03. Salesforce Integer Decimal Datatypes Type Casting| No fear of Salesforce Coding | Coding is Easy

Поділитися
Вставка
  • Опубліковано 12 лют 2024
  • +919652955429
    #Salesforce #ApexDatatypesVariables #Loops by Swapna @Swapna Salesforce
    (Datatypes, Primitive, Sobject, Collection, Enumeration, Variables, Local, Instance, Class, Constant, Assignment, Statements, Expressions, Loops, Do While, While, For)
    06. • Salesforce Apex 13 | D...
    #Salesforce #Apex #Programming Session Links
    *(Salesfoce Map, Declare Map, Map Datatype, Difference Between Set, List, Map, Map Size, Map Values, Map Keys, Add New Key and Value in Map,
    Remove Specific Key and Value in Map, If Condition, Enum)*
    05. • Salesforce Apex from S...
    *(Set, List, Map, Map(set,set), Map(list,list), Map(list,set), Map(set,list), Set(Integer), List(String), Methods in Map, Map.Keyset, Map.Values,
    Map.Size, Map.Put, Map.Get, Map.Remove, System.Debug)*
    04. • Salesforce Apex from S...
    (Set, List, Map, add(), size(), remove(), empty(),clone(), clear(), tostring(), system.debug, boolean,)
    03. • Salesforce Apex 10 | L...
    (Debug Apex Program, Primitive, Sobject, Collection, List)
    02. • Video
    01. • Video
    *****
    Notes
    Data Types :
    1.Premitive Data Type
    2.Sobject Data Type
    3.Collection Data Type
    4.Enumeration Data Type
    Variable : Any unfixed value used in apex code/program
    1.Local Variable
    2.Instance Variable
    3.Class Variable
    4.Constant : Any Fixed value used in Apex code/Program, Constant is defined by using Keyword Final
    Assignment Statements: a statement that places a value into variable integer A=2
    Expressions : an expression is a construct made up of variables, operators and method invocation that evaluates to single value.
    Conditional Statement
    Loops :
    Repeating of statement till a condition is scucceded
    There are 5 types of loops are avaialble
    1.Do-while
    2.While
    3.For --. Primitive Data type
    4.For --. Collection Data type
    5.For --. SOQL
    1.Do-While : Same work doing again and again -- repeating work Do while loop is reactive loop
    do
    .
    code_block
    .
    while(condition);
    2.While Loop : Repeatedly executes block of code as long as particular Boolean Condition remains true
    While proactive
    While(Condition)
    .
    Code_block
    .
    Account.id--. List of contact id--. related list of cases Records
    Account --. contact
    contact --. cases
    Parent (Child )Query
    Select Id, Name,(Select Id from Contact) from Account
    Select Id, accountid from Contact
    Program:
    Final Integer A=2; //Constant Assignment Statement
    Final Integer B=8; //Constant Assignment Statement
    Integer R; //varaible
    R=A*B; /// Expression Statemetn
    System.debug('The Area is '+R);//Expression Statement
    //For Sobject :
    Account A= New Account();// varaible, Expressions Statement
    patient__c pat= New patient__c();
    // ***Loop ********
    //01. Do while Loop --. Reactive loop -- First Action then Condition
    Integer Count=0;
    Do
    .
    Account A= New Account();
    A.Name='Loop Technology_1908';
    A.Phone='111111';
    insert A;
    Count++;
    .
    While (Count.10);
    //02. while Loop --. Proactive loop -- First Condition then Action
    Integer Count=0;
    while(count.10)
    .
    system.debug('Hi while '+count);
    Count++;
    .
    //Write a program to calculate Sum of even numbers up to the given number.
    Integer Num=30;
    Integer Result=0;
    string Choice='od';
    if(Choice=='Even'|| Choice=='Ev')
    .
    Integer Count=0;
    While (Count.Num) //4.10
    .
    system.debug('event Numbers '+Count);
    Result=Result+Count;//2+4
    Count=Count+2; //4
    .
    system.debug(Result);
    .
    Else if(Choice=='Odd'|| Choice=='od')
    .
    Integer Count=1;
    While (Count.Num) //4.10
    .
    system.debug('event Numbers '+Count);
    Result=Result+Count;//2+4
    Count=Count+2; //4
    .
    system.debug(Result);
    .
    Else
    .
    system.debug('Looks like you are lost in Code');
    .
    Assignments
    1.Write a program to print sum of odd number based given number ?
    2.Write a program to print odd numbers as well as even numbers based on given number ?
    3.Write a program to reverse the given number (12345== 54321)?
    4.Write a program to check numberic or alphabet, if it is numeric then print the number ['This is Numeric :'+ number]
    5.Write a program to get the list of cases of each contact as well as related Accounts?
    Interview Questions
    01.What is the Variable?
    02.How do we declare the varaible?
    03.What is the constant ?
    04.What is the keyword to declare the Constant?
    05.Once the value is declared, Is it possible to change the varaible value ?
    06.What is Assignment statement?
    07.Give examples for Assignment statement?
    08.How do we declare the expression ?
    09.What is Loop ?
    10.What are the differnet types of loops ?
    11.What is do-while ?
    12.What is the while loop ?
    13.What is difference between do-while and while ?
    14.What is skeleton structure of do-while
    15.What is skeleton structure of while?
    *************
    Trailhead Practice
    trailhead.salesforce.com/cont...
    trailhead.salesforce.com/en/c...
    *****

КОМЕНТАРІ •