Introduction to Class, Method, Static and OOPs Concept in Apex | Day 2

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ส.ค. 2024
  • Anatomy of a Class, Methods, Static Vs Instance, Pass by Value Vs Pass by Reference
    Extending a Class, Interfaces
    Check below post for assignment and PPT: www.apexhours.com/oop-and-coll...
    #Day2 #PassByValue #PassByReference #StaticVariable #Methods
    0:00 Introduction
    5:36 Anatomy of a Class
    16:02 Class and Object
    19:00 Method in Apex
    21:48 Class in Action
    22:08 Demo 1: Defining a Class in Apex
    31:12 Static Vs Instance
    34:28 Demo 2 : Static and Instance method
    50:27 Pass by Value Vs Pass by Reference
    1:00:10 Extending a Class, Virtual Keyword
    1:02:32 Demo 4 : Inheritance in Apex
    1:06:00 Interfaces in Apex
    1:08:35 Demo 5 : Interfaces
    1:13:57 Trailhead
    1:14:56 Assignment

ความคิดเห็น • 136

  • @apexhours
    @apexhours  2 ปีที่แล้ว +1

    Check Code and PPT here : www.apexhours.com/oop-and-collection-in-apex/

  • @sohbetdovranov1362
    @sohbetdovranov1362 3 ปีที่แล้ว +45

    you guys are doing an amazing job basically for FREE. Not sure if I could find such concepts even in paid platforms as well, so much thanks for this! so straightforward and amazing explanation!

    • @apexhours
      @apexhours  3 ปีที่แล้ว +4

      Keep watching. Glad you like it. THANKS TO KEEP US MOTIVATED.

  • @avash2009
    @avash2009 2 ปีที่แล้ว +4

    This youtube channel is a treasure trove of Everything Salesforce . Special thanks to Jigar . Great presentation !

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      So nice of you

  • @karthikeyans4753
    @karthikeyans4753 3 ปีที่แล้ว +3

    So great that you covered a whole lot of concepts in one single hour with an awesome explanation. Exactly what I was looking for. Please keep teaching us !! :)

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Keep watching full playlist www.apexhours.com/apex-hours-for-students-developer-program/

  • @apexhours
    @apexhours  2 ปีที่แล้ว

    Check this blog post for complete FREE Salesforce Developer Training www.apexhours.com/salesforce-developer-training-free/

  • @olavozapata
    @olavozapata 4 ปีที่แล้ว +2

    Congrats guys the content are great! Grateful for that.

  • @aparichit-thestranger3862
    @aparichit-thestranger3862 2 ปีที่แล้ว +3

    Thanks for all this amazing content, Apex hours team.

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      Glad you enjoy it!

  • @anithasoundararajan385
    @anithasoundararajan385 2 ปีที่แล้ว +2

    I was searching for videos for apex in SF and came across this ...worth watching all concepts is clearly explained ..Iam happy I found this .I already have core Java background so I clearly understood all in one listen.

  • @fatips1187
    @fatips1187 2 ปีที่แล้ว

    tnx for this playlist..u saved many who wants to crack admin,developer certification.Im on a binge watch of ur entire playlist...

  • @giritharakannan.d2557
    @giritharakannan.d2557 3 ปีที่แล้ว +1

    Thank you so much for spent your to time to teach us and its easy to understand...!

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Glad it was helpful! Please like and share

  • @vivekkapil4571
    @vivekkapil4571 2 ปีที่แล้ว +1

    very very helpful after aws got switch into salesforce developer now i am pretty sure with the help of these mentor i can do it :)

    • @apexhours
      @apexhours  2 ปีที่แล้ว +1

      Glad it was helpful!

  • @nikhiltiwari9604
    @nikhiltiwari9604 2 ปีที่แล้ว +1

    So many basic concepts cleared thanks for a great help

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      You are welcome!

  • @ayushmishra3388
    @ayushmishra3388 3 ปีที่แล้ว +4

    by the way @43:24 it didnt work because printout is static method, and helloWorldString is non-statc variable, and you cant access non-statc variable in static functions, but non-static fun can access static variables

  • @unicorngames3008
    @unicorngames3008 4 ปีที่แล้ว +1

    thanks for making this video really helped

    • @apexhours
      @apexhours  4 ปีที่แล้ว

      Glad it helped!

  • @Nancysunshine1
    @Nancysunshine1 4 ปีที่แล้ว +5

    Thanks..this is the best I got in TH-cam

  • @prajwalsrinivas5157
    @prajwalsrinivas5157 10 หลายเดือนก่อน +1

    Hey, thank you for posting such great content. Just a humble suggestion, it would be beneficial if real life use cases are posted for every method so that we are clear about why is it relevant to learn what ever is being taught.

    • @apexhours
      @apexhours  10 หลายเดือนก่อน

      Thanks for the tip!

  • @razamehdi293
    @razamehdi293 3 ปีที่แล้ว +1

    Thank you apex hour. Im from Pakistan. Doing great job

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      keep watching

  • @standupCoding
    @standupCoding 2 ปีที่แล้ว +2

    50:31 Just like C and Java, Apex is also always pass by value. User defined datatypes are NOT passed by reference, rather the reference is passed (i.e., the memory address) by value.

  • @chiranjeeviommijeevi722
    @chiranjeeviommijeevi722 4 ปีที่แล้ว +1

    Thank you for helping salesforce Dev, I would like to know about call-by-value and call-by-reference examples that you used in the video.
    The "String" is internally an object type and its memory allocation is in Heap. So, both in Call-byValue method or in Call by Ref method, its (string variable) value should get updated.
    Even though its data type is called primitive data-type but still memory is referenced as address.

  • @ravivarma8988
    @ravivarma8988 ปีที่แล้ว +1

    Wow! it's Amazing I did it well ! Perfect work !

  • @Akshay.00001
    @Akshay.00001 3 ปีที่แล้ว +1

    very very helpful .. thank you Jigar

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Happy to help

  • @sushantsingh6841
    @sushantsingh6841 3 ปีที่แล้ว +1

    Hello Team, Thank you for this amazing series of videos. I am currently working on the assignment of this video and I had a doubt. The printOutput() function that is to be written, I was wondering if there would be two different printOutput() functions for add or multiply or there would be only one with a generic return statement? Thanks..!!

  • @MrDannyddog
    @MrDannyddog 3 ปีที่แล้ว +13

    Hi Jigar, the video got real messed up from 41:05 point on where you tried explaining the 'this' Keyword. Got very disappointed by the way you rushed it and said try to get a hold of this instead of going slow and explain the constructor chaining you did there.

    • @tejasbagade504
      @tejasbagade504 3 ปีที่แล้ว +7

      You are right, even I tried to listen to that part for 2-3 times, and could not get a hold of it :D

    • @HarrySalesforce
      @HarrySalesforce 3 ปีที่แล้ว +1

      Me too feeling the same :(

    • @sosu4u
      @sosu4u 3 ปีที่แล้ว

      This keyword we use to assign values to current instance of an class. Basically here he used while class declaration. If we use object then new instance will create for class and values of variables will change as per object instance value passed.

  • @vikasgoswami7613
    @vikasgoswami7613 2 ปีที่แล้ว +1

    Sir i have no background of coding or cs, still found these videos very informative and interesting..
    Thank you sir

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      Glad to hear that

  • @rsdeveloperspropertyconsul2048
    @rsdeveloperspropertyconsul2048 4 ปีที่แล้ว +1

    thank you so much....

  • @heikokraemer2735
    @heikokraemer2735 4 ปีที่แล้ว +3

    Thank you very much guys! That session answered a lot of my questions.

    • @apexhours
      @apexhours  4 ปีที่แล้ว +1

      Glad it helped you. Please check full playlist

    • @BBPrasad0412
      @BBPrasad0412 4 ปีที่แล้ว

      @@apexhours Very good attempt and way of explanation is phenomenal.

  • @funeducation6148
    @funeducation6148 3 ปีที่แล้ว +1

    amazing job guys I have gone through your admin course as well i have just one word to say AMAZING and thanks for helping newcomers

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Awesome, thank you! IT MEANS ALOT FOR US. KEEP WATCHING

  • @sophieyyyhh0057
    @sophieyyyhh0057 ปีที่แล้ว +1

    Amazing classes on apex sir 👌👌👌

    • @apexhours
      @apexhours  ปีที่แล้ว +1

      Glad you like them!

  • @tejasbagade504
    @tejasbagade504 3 ปีที่แล้ว +1

    Hi, Can you tell me how can I decide whether to use Static Method or Instance Method ?

  • @hemlatha898
    @hemlatha898 ปีที่แล้ว +1

    A Big Thank you

  • @gokuldaghale4195
    @gokuldaghale4195 3 ปีที่แล้ว +1

    Thank you

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      You're welcome. Keep watching

  • @maheshb5703
    @maheshb5703 2 ปีที่แล้ว

    In the pass by value method it has to be websiteUrl instead of websiteurl value. kindly check and want how that in pass by value scenario.

  • @kaszaspeter77
    @kaszaspeter77 2 ปีที่แล้ว +1

    ByVal vs ByRef: am I the only one who is put off by the fact that the two variables demonstrating ByVal are not the same? it is webSiteURL vs webSiteURLValue, right? When you call the ByVal function by webSiteURL, the function itself returns webSiteURLValue, isn't that a problem?

  • @hidekotakada8782
    @hidekotakada8782 2 ปีที่แล้ว +2

    Your lecture is very helpful for beginners but there is one thing I am confused about. You said "Class is a static entity" however, salesforce documentation says that "Apex classes can’t be static." Which is correct?

    • @deepaksai3637
      @deepaksai3637 ปีที่แล้ว +2

      Static class cannot be instantiated(cant't use new keyword to create variables of that class type).........So Apex classes are non-static.

  • @hezeebusaimadhukar206
    @hezeebusaimadhukar206 ปีที่แล้ว

    Teaching is excellent and its a wonderful opportunity given by the team.
    But as I dont have any previous coding experience it is very much difficult to understand.
    Any tips on this please. Do i need to learn any other programming language first :(

  • @_DheerajIPPILI
    @_DheerajIPPILI 2 ปีที่แล้ว +1

    I am getting the below error when I am executing the pass-by value.

  • @yatin1370
    @yatin1370 ปีที่แล้ว +2

    First of all, I appreciate the free content you have provided us, so thanks for that.
    However, there should be some disclaimers stating that a good grip on Java is a must to comprehend almost everything in this lecture. If an absolute beginner (just an admin) comes across the content directly, there is no way they shall be able to understand this.
    Also I found below anomalies:
    1. There is only 'Pass by value'. Not by reference. In primitives, content value is passed. In case of objects, the address of memory where that object resides(which is the reference/variable) is passed as value. That's why a new/copy object is not created in method call. It references the same object so the object members are modified if changed inside method.
    2. Below is never explained for beginners:
    An object instantiation can have below format:
    Super class reference/variable = new Super Class Object. OR
    Super class reference/variable = new Child Class Object.
    But you cannot have a child class reference and super class Object.
    3. Continuing previous point, for this Object creation:
    Super class reference/variable = new Child Class Object
    Its possible to call only methods defined in Super class, not the new ones(other than inherited ones) defined in Child class.
    4. Interfaces are like parent classes, but contain only ABSTRACT methods( methods without a body to be overriden).
    Hence below is possible for interfaces too:
    Super class reference/variable = new Child Class Object.
    That said, a strong base in Java is must as per this session.

    • @apexhours
      @apexhours  ปีที่แล้ว

      It good to have but not needed in day to day development work, You will find hardly find ABSTRACT classes in Salesforce Development. We are teaching Apex here and expecting you have OOPS knowledge

    • @OLOGY009
      @OLOGY009 6 หลายเดือนก่อน

      yes i have no prior knowledge on JAVA i get confused when codes are copied and pasted

  • @nialloconnell
    @nialloconnell 3 หลายเดือนก่อน

    Hi there, I love the content and learning so much. I have a question if anyone could help me out. For the Static and Instance Method section, when no value is passed in from Anon window, how has 'helloWorldString' been assigned the DEFAULT_STRING value? From what I can see it hasn't been explicitly assigned anywhere put on he debug log it still outputs 'Hello World'. Any help would be greatly appreciated.

  • @rajisadhu4713
    @rajisadhu4713 2 ปีที่แล้ว +2

    liked it

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      Keep watching

  • @shaswat6297
    @shaswat6297 2 ปีที่แล้ว +1

    11:05 scope/ access variables.

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      keep wATCHING

  • @sathyakandasamy6640
    @sathyakandasamy6640 3 ปีที่แล้ว +1

    What are the contents cover for salesforce certificate exam, I preparing for exam, watching ur video good explanation say what are the topic be strong in salesforce kindly request plz reply

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Yes it cover the exam topics. but it not build for exam only.

  • @debmalyaray1997
    @debmalyaray1997 2 ปีที่แล้ว +3

    sir here one thing you have missed in pass by reference that you should have mentioned this thing that Account is a standard object provided in salesforce that we are implementing in apex where we are instantiating by considering it as a class while writing code in apex and after that we are accessing the various standard fields of that account object and modifying it.....As I am already on developer side I understood this thing but it would be very difficult for complete beginners to catch this point so please sir from next time keep these things in mind...thank you.

    • @debmalyaray1997
      @debmalyaray1997 2 ปีที่แล้ว +2

      likewise you are missing on lot of points in this video and the previous one and hence it would be a lot lot more difficult for beginners to catch the important concepts....

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      Thank you so much for your feedback. We will take care in future. Keep watching the full playlist

    • @apexhours
      @apexhours  2 ปีที่แล้ว +2

      We covered most of the point in different sessions. It a 12 session series. Please complete all of them and let me know the missing topic I would love to create new recording on same or I can teach you personally too. I would say check agenda of each session here first www.apexhours.com/apex-hours-for-students-developer-program/

    • @user-vr2ci9db3n
      @user-vr2ci9db3n 9 หลายเดือนก่อน

      Sir, I am having finance edu backround. no coding basically. so...is this fair to go for this apex develpoment course?
      @@apexhours

  • @kva7922046
    @kva7922046 3 ปีที่แล้ว +1

    Great video, but my code isn't running properly due to "Unexpected token"s. Anyone have any insight?

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Please check this post for code www.apexhours.com/apex-hours-for-students-developer-program/

  • @abhishekswami456
    @abhishekswami456 2 ปีที่แล้ว +3

    public class MathCalculator
    {
    Public Integer add(Integer a, Integer b)
    {
    return a+b;
    }
    Public Integer multiply(Integer a, Integer b)
    {
    return a*b;
    }

    Public void printOutput(Integer a, Integer b)
    {
    System.debug('Summation of 2 values: ' + add(a,b));
    System.debug('Multiplication of 2 values: ' + multiply(a,b));
    }
    public void doMath(Integer a, Integer b)
    {
    printOutput(a, b);
    }
    }

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      keep watching

  • @vineetskit
    @vineetskit 4 ปีที่แล้ว +1

    same old concepts but extraordinary explanation .

    • @apexhours
      @apexhours  4 ปีที่แล้ว

      thanks

    • @7praneeth
      @7praneeth 4 ปีที่แล้ว

      Salesforce Apex Hours Please add the code for the assignment

  • @guesswho6684
    @guesswho6684 2 ปีที่แล้ว +1

    how does it work? You did not assigne helloWorldString in the first instance call...why did it take a value of DEFAULT_STRING?

    • @nialloconnell
      @nialloconnell 3 หลายเดือนก่อน

      I am also wondering this.

  • @ekanshlohabare1294
    @ekanshlohabare1294 2 ปีที่แล้ว

    I am getting an error: method does not exist or incorrect signature void mainValueMethod() please help me with that

  • @marvaclarke8751
    @marvaclarke8751 ปีที่แล้ว +2

    Hello is there an actual class for the developer hours that you can attend?

    • @apexhours
      @apexhours  ปีที่แล้ว

      We will plan soon new batch

  • @HONDACBR650R_Abhishek
    @HONDACBR650R_Abhishek 4 ปีที่แล้ว +1

    I have completed my Assignment for day 1 and 2. I wanted to confirm if the code that i have written is correct or not. Where can i find the solution fro the assignment?

    • @apexhours
      @apexhours  4 ปีที่แล้ว

      Please check our ApexHours.com site for solution

  • @debmalyaray1997
    @debmalyaray1997 2 ปีที่แล้ว +1

    after completion of this course can i crack the developer pd-1 certification by Salesforce??

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      This course is not developer for PD-1 certification but It will help you for your certification and day to day job.

  • @7praneeth
    @7praneeth 4 ปีที่แล้ว +3

    Can you please post the code for the assignment?

    • @apexhours
      @apexhours  4 ปีที่แล้ว

      Code is available on blog post

  • @selimsnp1359
    @selimsnp1359 2 ปีที่แล้ว

    Line: 2, Column: 4
    Method does not exist or incorrect signature: void mainValueMethod() from the type Demo3
    This error can be fixed by saving your class

  • @sravsp7696
    @sravsp7696 3 ปีที่แล้ว +1

    where can we find the guides mentioned in the video?

    • @apexhours
      @apexhours  3 ปีที่แล้ว

      Available on ApexHours.com website

  • @lasyagargaye6008
    @lasyagargaye6008 2 ปีที่แล้ว +1

    I don't find the answers in blog for assignment u provided...can you please provide the link here.

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      All answer are provided in blog comment

    • @lasyagargaye6008
      @lasyagargaye6008 2 ปีที่แล้ว

      @@apexhours Thanks great session I like it

  • @_DheerajIPPILI
    @_DheerajIPPILI 2 ปีที่แล้ว

    Line: 2, Column: 4
    Method does not exist or incorrect signature: void mainValueMethod() from the type Demo3

    • @srinivas6951
      @srinivas6951 ปีที่แล้ว

      did you solve this? if, what is the solution?

  • @rajisadhu4713
    @rajisadhu4713 2 ปีที่แล้ว +1

    do you offer training ?on salesforce

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      No. We only do free training

  • @raghumylapilli2054
    @raghumylapilli2054 4 ปีที่แล้ว

    Want the day3 video.. Soon

    • @apexhours
      @apexhours  4 ปีที่แล้ว +1

      Coming soon

  • @raghumylapilli2054
    @raghumylapilli2054 4 ปีที่แล้ว +1

    Day2 Assignment -- th-cam.com/play/PLbpC6QDcJ6nHbQDEVhYCJ_d4zvFH88Vk7.html

    • @apexhours
      @apexhours  4 ปีที่แล้ว +1

      Keep it up

  • @priyashekhawat8990
    @priyashekhawat8990 2 ปีที่แล้ว +1

    hii sir,
    where will the coding challenge solution will found.

    • @apexhours
      @apexhours  2 ปีที่แล้ว

      In the description. We provided blog post link Check that

  • @anjilakushwaha4150
    @anjilakushwaha4150 4 ปีที่แล้ว +1

    Where i will get all assignment answers ?

    • @apexhours
      @apexhours  4 ปีที่แล้ว +1

      Check this post www.apexhours.com/apex-hours-for-students-developer-program/

    • @050138
      @050138 4 ปีที่แล้ว

      There is no answer for this challenge in the blog! Can you please provide the solution?

  • @umapathiyadav4400
    @umapathiyadav4400 2 ปีที่แล้ว +1

    can we get PDF document

  • @dreamgamer8891
    @dreamgamer8891 หลายเดือนก่อน

    Hello Team,
    Kindly let me know how can I make this better:
    public class Mathcalculator {
    private integer a = 12;
    private integer b = 10;
    private integer answer ;
    public void Addition(){
    answer = a + b ;
    system.debug('a+b=' +answer );
    }
    public void Subtraction(){
    answer = a - b ;
    system.debug('a - b=' +answer );
    }
    public void multiplication(){
    answer = a * b ;
    system.debug('a * b=' + answer );
    }
    public void division(){
    answer = a / b ;
    system.debug('a / b=' + answer );
    }
    }
    //////////////////////
    Mathcalculator Add = new Mathcalculator();
    Add.Addition();
    Add.Substraction();
    Add.Multiplication();
    Add.Division();

  • @sunapila
    @sunapila 11 หลายเดือนก่อน +2

    public class MathCalculator {
    Integer addedValue;
    Integer multipliedValue;

    private static void printOutput(Integer calculateValue){
    System.debug('Calculate Value is: '+calculateValue);
    }

    public void doMath(String operationType, Integer First, Integer Second){
    if(operationType=='M'){
    multipliedValue=First*Second;
    MathCalculator.printOutput(multipliedValue);
    }
    else if(operationType=='A'){
    addedValue=First+Second;
    MathCalculator.printOutput(addedValue);
    }
    else{System.debug('Wrong Parameter');}
    }
    }
    Anonymous Window:
    MathCalculator Calc = new MathCalculator();
    Calc.doMath('M',7,7);
    Calc.doMath('A',7,7);
    Calc.doMath('X',7,7);

    • @apexhours
      @apexhours  11 หลายเดือนก่อน

      Keep up the good work

  • @shashankgaikwad1043
    @shashankgaikwad1043 2 ปีที่แล้ว +2

    *ASSIGNMENT*
    CLASS
    public class MathCal {
    integer sum = 0, mul=1;
    public void add(integer a, integer b){
    sum=a+b;
    PrintOutput(sum);
    }
    public void mul(integer a, integer b){
    mul=a*b;
    PrintOutput(mul);
    }
    public void PrintOutput(Integer show){
    System.debug(show);
    }
    }
    ANONYMOUS WINDOW
    list num = new list();
    for(integer i=0; i

  • @ShivendraSingh-kr5hj
    @ShivendraSingh-kr5hj 3 ปีที่แล้ว

    why do u say "typically" again and again bro

    • @apexhours
      @apexhours  3 ปีที่แล้ว +1

      Thanks for your feedback. We will take care in future

  • @chilukuriraghu231
    @chilukuriraghu231 หลายเดือนก่อน

    your explanation Is Too Confusing Sir. A person Who Is A Beginner will Surely Couldn't Able To Understand This Make Live Examples And Explain

  • @sachinkumarmehrotra7986
    @sachinkumarmehrotra7986 4 ปีที่แล้ว +2

    the way of teaching is really disgusting because for each topic u are giving only one example and that to is so abate .

    • @apexhours
      @apexhours  4 ปีที่แล้ว

      That session was scheduled for only one hours. Its hard to cover everything in just one hours.

    • @Nancysunshine1
      @Nancysunshine1 4 ปีที่แล้ว +3

      Sufficient for us to understand

    • @anithasoundararajan385
      @anithasoundararajan385 2 ปีที่แล้ว

      Yes sufficient for us to understand who already know Java ...u are going good 👍

  • @kiranvrao9714
    @kiranvrao9714 7 หลายเดือนก่อน +1

    Thank you

    • @apexhours
      @apexhours  7 หลายเดือนก่อน

      You're welcome