 Hello. Hi, everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So hi. Hi, everyone. I hope you are able to see me. So today we are going to start Apex Programming. So I hope you are ready for that. And I'm your host and speaker or you can say trainer for this session. So I will be delivering today like what is introduction to Apex, right? So I will be waiting for more folks to join. And then we'll be starting. So hello and welcome, everyone. So first phase of this bootcamp is completed. So we discussed about like admin, we discussed about flows. So basically, now we are going to start development. And we'll be first learning Apex. So all the things related to Apex like trigger test classes as synchronous Apex. And then after that we'll be starting lightning web component. So just just wanted to know whether you are able to listen me properly is my voice clear to you, everyone just post a message in the chat so that I can see whether you are able to listen me properly or not. So just post a message in the chat so that I can know like whether you are able to listen me properly. Okay, so I hope everybody is able to listen me properly. I just read your response. And now I'm going to start with today's session. So first of all, welcome everyone. And like you can see phase two of this admin project is getting, sorry, this Salesforce bootcamp is starting. And in this session, we are going to learn about development. Right. So I can see many folks are new to this development project. They were development bootcamp. They were waiting when I will be starting Apex programming. So for them, I'm going to introduce myself again. So you can see, first of all, I want to express gratitude to all my viewers and subscribers. And you can see this beautiful picture. So basically I'm based out of Jaipur, which is located in India. And it is very beautiful city, which is also known as pink city. So I am from Jaipur, India. I just want to know from which location you are joining this bootcamp. So quickly post your location in the chat so that we can know like from which locations people are joining this bootcamp. So I'm going to share this screen as well, where we can see live chat and like viewers count. So just just paste your location in the chat so that I can know from which location you are joining the bootcamp. And please try to find out like whoever is joining from your location as well. So quickly post your location in the chat so that everybody know from which location of the whole world people are watching or learning Salesforce. So here you can see numbers are growing. And I'm very happy like people from all over the world joining this bootcamp. So I can see people are joining from Indore, Mumbai, Bangalore, Haryana, Hyderabad, USA, West Bengal, Bangalore, Pune, Andhra Pradesh, again USA, Mumbai, Nagpur, Delhi, Varanasi, so Raji as well, Bhopal. So I can see from different locations of India is covered. And I can see few folks are from USA as well. And I can see few people are from Rajasthan as well from where I am actually. So from UP Andhra Pradesh, so Odisha, Vishakapatnam, people are from Turkey as well. So this is very great to hear like people from all over the world joining this bootcamp. So I can see Paridhi is from Jaipur. Welcome. Sachin is from Germany, Nizamabad. So lots of people are joining. So now after this, I just want to know like what kind of audience I have. So here in this slide, you can see, you just need to post two things so that I can plan my sessions accordingly. So I just want to know whether you are a student or fresher. If you're a student or fresher from which college or university you are graduated or if you are working as a professional, so in which company you are working. So I just want to know your profession so that I can plan my sessions accordingly. So please post your profession like if you are fresher or student from which college you graduated or if you are a professional working in a company like you recently joined a company or you are one or two year experience folks. So with which company you are located. So just want to know. So please write the name of college or university as well as company so that you also get to know from which location or from which college or university you are passed out or from which company you are associated and joining this bootcamp. So please post this information so we can see lots of people are joining and like in this live session I can see more than 200 concurrent viewers are available and if you like these bootcamp sessions so please like the video so that more and more people get motivated and they can learn Salesforce. So I can see people are from different backgrounds available. So I can see some professionals some students some freshers people are joining from different companies like TCS, Tech, Mahindra. I can see career gap folks as well. I can see CapGermany folks, Tawant some freshers. I can see professionals from India Mart professionals from Accenture. So like I'm having mixed audience in this bootcamp so that is very great. So I will be plan my sessions accordingly so that beginners as well as intermediate folks will be benefited with this bootcamp. So keep on posting your location whether you are a student or fresher or professional or you are associated with which college university or company so that everybody get to know with which location college university or company you are. Right. So now I want to introduce myself. So I am Sanjay Gupta and like from January I am doing this bootcamp totally free for the Salesforce and Railblazer community because I can see in this job market or in this Salesforce ecosystem many people want to move but they don't have proper guidance they don't have proper learning and if they want to learn so they are being charged with a lot of amount. So I just wanted to bridge that gap and want to provide some learning totally free of cost so that if you are not able to pay huge amount to the organization so you can just upskill your knowledge. So I'm founder instructor and career coach at Sanjay Gupta Tech School which is my own venture and I worked in Salesforce, I worked in tax on demand, I worked in Aperio which was part of a Vipro. So in totality I have 16 plus years of experience. I have mixed experience so I taught 10 years in technical, I taught 10 years technical education in industry as a professor and from last six years I'm working as working in IT industry I worked as a developer currently I'm working as a manager and trainer as well. So I have mixed kind of experience I have teaching as well as IT industry experience so this makes me more powerful as compared to other instructors because I know what to teach because of IT experience, I know how to teach because of education industry experience so this is a mix of both and this makes me powerful and you can see from last two months I'm helping students, freshers and professionals so that they can ramp their career in Salesforce ecosystem. Prior to that I created lots of videos, more than 300 recorded videos and those I created in last three years and those are totally available freely on YouTube, right? So this is me now moving forward so now coming on to the session so like we get to know each other now let's get started with that actual session because my nature is I don't waste much time on these discussions I just come to the point very quickly, right? So here you can see from last two months those who are joining these sessions regularly they are following these virtual learning best practices so just focus on all the live sessions all the sessions will be live delivered by me only and you can take proper notes for future reference and you can ask doubt after the session so basically I have divided my session into two parts like first I will be explaining all the things and then I do Q&A session so that I can answer all the questions and don't miss any session because all the topics are connected practice each session because I have exercise sheet as well so for each day I provide exercise sheet like a bunch of questions those you can practice at your own and we have a telegram group as well where people are discussing those doubts and like if you have any doubt during practice so you can ask in the YouTube comment section and you can join the telegram group and that telegram group link is available in the description of this video so from there you will be able to join and keep doing all the things every day so that you can build strong foundation so that you can have a job if you already have job that is very good so that you can strengthen your skills right so this is my favorite slide and throughout the bootcamp I am following this so first word says consistency right so I am consistent throughout this bootcamp and from last two months I have delivered total 31 sessions every week I am doing live and free sessions and I will continue this throughout the year so I I just announced the these sessions will be for six months but later six months I will be doing all the cloud related sessions those I know and like you can see you also need to follow consistency is the key so you just need to do regular practice and how you can do that regular practice so I have created a exercise sheet so I will be sharing that sheet link in the chat as well later on if you want to see that so this link is available in the description of the video so from there you can have that sheet right so for me consistency is the key if you follow everything on regular basis so you will be able to learn the things right so I'm here with you so that you can follow proper schedule I will be available every week three to four days three to four sessions I will be doing so that you can understand the things so moving forward here you can see I am spending one hour 30 minutes in each session so initial 50s or 60 minutes I do topic explanations and demo and later 30 to 40 minutes I do Q&A so I try to cover as many questions as I can right so here like here you can see at two places you can ask questions you can ask questions in the comment sections of YouTube videos and the self-help group is becoming more popular so if you join this self-help group so you can see more than thousands of candidates are part of that group and they are learning on daily basis so if you are not member of that group you can just join that and this is our Salesforce development bootcamp timeline so last two weeks were related to flows if you missed you can go and learn about flows and this week I'm going to explain all the things related to Apex so initially I decided to do Apex session for one week but when I like gone through all the sessions related to admin and flow I realized there are many folks with who are freshers they don't know much about coding they are from non-tech background they are from different engineering branches so I just like decided to do Apex sessions for three weeks so that we can understand each and every aspect and detail right so next this week and upcoming two weeks are dedicated for Apex and then we'll be picking about learning about Apex trigger right so if you want to this slide is also important so I would prefer do it right away so whatever platform you use frequently YouTube, LinkedIn, Instagram or Telegram just search Sanjay Gupta Tech School there and you can just follow me there so that you can receive all the notifications right I am sending notifications on daily basis whenever there is session so you can just follow me on my organization on these platforms so that you can receive the notifications right so many folks scroll Instagram on regular basis so you can just follow me there if you use Telegram frequently you can follow it if you use like you are professional you are using LinkedIn on daily basis you can follow me there and YouTube you have to follow because all the sessions I am doing on YouTube so just share this information with everybody and here you can see on my channel see C++, Java, Salesforce admin and development content is already available and I am doing these sessions live for everybody and my upcoming courses will be Salesforce cloud, cybersecurity, DevOps, data science and web development and when in which cybersecurity bootcamp I will be starting from next month right so I won't be delivering my friend who is expert in cybersecurity so we both will be available with you and we'll try to do that bootcamp together right so have a eye on that bootcamp so it will be starting mid of April okay so after this lots of content that I explained to you now coming on to the main topic right so this is our first session related to Apex so I will be giving brief introduction to Apex so initial slides will be having some theoretical content those I will be explaining little bit and then I will be doing some hands-on as well so you you guys if you are following me on regular basis so many folks know me like first I explain the concept and then I immediately jump to demonstration so that if we do some demonstration so we understand it well so I I just we called a quote right now so there are three lines which are very important that everybody needs to know so what we listen we forget so what we listen we forget what we write we remember and third is what we do we understand right so if we if we do more we will be understanding more so that's why all the sessions are more we focus on demo right so let's understand what Apex is quickly and then I will be doing some demonstration right so I am just shifting me on the top so that you can see the content properly because content is important as compared to me so if we if we talk about Apex so first thing that you need to understand Apex is basically object oriented programming language right so in in object oriented programming basically we use classes interfaces and inheritance right we like if if I compare Apex so it is basically similar to Java so whatever syntax we have in Java so similar syntax we follow in Apex as well right so you might be thinking whether I will be starting Apex sessions from the very beginning will I be explaining all the key concepts of object oriented or object oriented programming so my answer will be yes right so next point says strongly typed so it validates references to objects at compile time so now we need to understand what is compile so whenever you write any code right so you will be saving that code and at the time of saving it will be converted into binary and all the errors will be checked at that time so that process is basically known as compilation so if you have any error so at the time of compilation you will see that error and if you remove that error you will be able to save your code otherwise not right next is integrated with the database so this is also important so as you know in Salesforce we have a database which we create with the help of admin features so basically in Apex you can fetch all the records and their fields as well so whatever whatever data you create in your Salesforce or that you can access in the Apex and you can modify that as well with the help of Apex so we'll see how we will be able to do that then next is enable developers to do sorry enable developers to add business logics so if you have attended all the sessions related to flow so in flow what happens we implement logic we implement logic without code but here in Apex you will be writing logic with the help of code okay so there is no point and click you just need to write everything through your hands and to add business logics to system events button clicks related record updates visual force pages and lightning component so initially you will see these terminologies are difficult if you are a beginner but as you attend all the sessions you will be understanding everything in detail and one can call Apex code through web service request and triggers on objects right so this is basic like if someone asks what Apex is so these points you can explain to the interviewer now if I move forward so these are few more points which are related to Apex so it is integrated it provides built-in support for common lightning platform idioms easy to use because it is similar to java data focused because you can perform all the operations with with the help of database and if your operation is failing you can roll back all the things right rigorous strongly tight language that uses direct reference to schema objects such as object and field apis so if you remember whenever we create any object or field so we provide a unique name that is known as api right so those you will be using directly in your Apex classes then it is hosted so it is executed and controlled entirely by the lightning platform so you don't need to install any other software so we have integrated environment that we can use to write Apex code then it is part of multi-tenant environment so Apex basically runs in multi-tenant environment like rest of the lightning platform so multi-tenant environment means things which we are using are shared right so if you are using any org so you are seeing it from the front end but in back end it is basically sharing the resources which are shared by other users as well right so that we can optimize our resources and if if you are not using the entire resource so that doesn't go waste so that is basically multi-tenant environment and easy to test so in Apex basically we write Apex test classes so basically it is easy to write and it is it is basically version so one can save Apex code against different versions so different versions are available so whenever there is any update so different version will be available so these are some features related to Apex then Apex is included in these editions right so these are simple names so we are right now using developer edition but in different editions it will be used right and these are the features so just go through all the points if someone asked like where we can use or when you can use Apex so these are the points where you will be able to use the Apex so just go through all the points and I hope you you can understand these points clearly so for web and email service service for complex validations for complex business logic and if you want to create custom logic custom means through code and if you want to perform any operations whenever the code is created updated or you you are deleting any record so and regardless like it is originated in UI visual force or from API so these are the points which says when Apex like use Apex when you want to perform these operations right now these are the features that we are going to discuss in the sessions so I will show you how we can create classes how we can create interfaces collections then objects array expressions variables and constant then conditional statements then we'll discuss about loops and here you can see it is cloud dev as it is stored compiled and executed in the cloud so everything whatever you will be writing it will be available on cloud so you can access your org from anywhere and all the code will be available there and we use triggers to call the methods we use database statements to query and search data transactions and rollback so if you perform any operation so that is basically known as a transaction if it is fails so that is basically known as rollback operation then we have global access modifier here which is more permissive than public so in other languages we have public and private so here we have global as well and versioning of custom code right so then we have development tools so initially we will be using developer console and later in the bootcamp we will be using visual studio code as well right so for beginner developer console is good because you are learning from the beginning so you you should know the basic features of Apex because if you are using visual studio code so that can be difficult for the beginners so we'll be using developer console then one more thing that you need to remember Apex is a case insensitive language so there are two types of languages one is case sensitive and one is case insensitive so in case sensitive basically what happens you need to focus on upper case and lower case both are treated as separately so if you have heard about c c plus plus java so these are case sensitive language if you have worked on javascript so that is also case sensitive but Apex is case insensitive which is similar to html so if you write something in upper case or lower case so that doesn't make a difference both will be considered as same but you need to follow the case sensitive nature because later on you will be learning lightning wrap component and lightning wrap components are basically implemented with the help of javascript and javascript is purely case sensitive now we need to understand what object oriented programming is so basically i already told you Apex is an object oriented programming language and now we need to understand what object is so basically object is a real world entity or problem right so object can be anything which exists in the world right so all the physical entities which are available in the world those are object so i will take a take an example as well like i will show you how in real life that object look like and how programmatically you can implement so if you want to represent object logically so for that we implement a class in Apex right and class basically forms base for object oriented programming so a class is a collection of variables and methods and variables are basically known as attributes and properties of an object whereas methods are known as behaviors right and once class is created then we can use it as a data type to create an instance right so this is the summary now before we go through that summary again about object oriented programming just read the slide right so it will guide you the difference between real world problem and how that real world problem we will be implementing with the help of class so let's say i have a object that is rectangle right rectangle is an object and rectangle basically has two attributes length and breadth right and if we want to calculate area and perimeter so these will be known as behaviors okay now if if i relate it to class how you will be creating the class so your class name will be rectangle and your attributes will be treated as variable variable basically we use in programming where we can store some data and methods are the operations or you can see behaviors that we will be implementing so actual business logic we will be implementing in the methods right so this is the blueprint of the class how you can implement it so this is high level design of the class and if you want to see how actually in programming you will see implementation of class so it is the like actual code that we'll be writing in the apex so just go through it and here you can see we have public class rectangle so rectangle is basically name of the class then we have two variables which are of type integer length and breadth if you want to store decimal point value so you can use decimal as well and then we have two methods here you can see first method is area and second method is parameter right and in area we have some parameters as well so this is basically syntax of class and i will be implementing this in today's session in front of you so that you can understand it clearly so if i go back to the slides again now you will be having better understanding of this so just go through this here you can see a class is a collection of variable and methods so we already saw this variables are attributes and properties and methods are behavior so this we already see and once class is created so you can use it as a data type to create an instance so if i go forward so here you can see how you can create instance of the class okay so we have class name so if you have rectangle class created so this way you can see the example rectangle is the class name then we need to define an instance so it is record and then after new again you will be writing class name and then parenthesis you need to define right so this way we need to follow this syntax if you want to create instance of the class okay so now we need to get familiar with the developer console where we will be implementing actual code and we will be working with anonymous window first and then i will show you how we can implement the class okay so here i'm just going to jump on the Salesforce org so what i'm doing let me just shift my display okay so now you will be able to see it clearly so here under top right corner where we have this gear icon from where we open the setup so here you can see we have developer console right if you click on this developer console so you will be able to see this UI so this is basically our developer console i am going to zoom it so that you can see it clearly so this is our developer console which is basically known as integrated development environment so you don't need to install any software if you want to practice apex programming right so here what you can see we have file then from here we can create new resource we can open existing resources then other menus are available which we will be using time to time right now if you want to do some programming in this IDE so how you will be doing that so here if you go to debug so here we have this option open execute anonymous window right so if you click on this so you will see so i'm just going to show you it on full screen so if i zoom in now so here you can see this is our anonymous window where you can write your apex code okay so whatever code you want to write you can write here directly without creating any class right so here what i'm going to do i'm going to write a integer and then i'm creating some variable so let's say i'm creating x equals to 5 y equals to 6 and then z right so here integer is the data type and x y z are variables so integer is data type and x y and z are variables okay now if you want to perform some operation on this so this way you will be doing so we are just adding x and y and the result will be available under the z variable right now what we need to do whatever result we have under this z variable we want to display it so to display the values what you will be doing you will be using this system dot debug statement right here you can write some equals to and then plus z so here also you need to understand whatever you want to display as is so that you need to enclose in single quotes right and okay yeah i mistakenly provided semicolon here it should be comma right so here you can see some equals to is available in single quotes and here after that plus and then z so this is like similar to constant it will display as is and z will be displaying its value on the as the output right so after implementing this so here you can see at bottom we have these buttons so these buttons are execute and execute highlighted so if you want to execute all the statement so you will be clicking on execute if you want to execute few lines let's say you have 10 lines written here and you want to run only two three lines so you can select them and click on execute highlighted and if you want to open the logs where you can see the results so you can just check this checkbox okay so i want to run all the statement so i'm just clicking on execute and you will see logs will be opened automatically and here we have this option debug only if i click on this so here i can see the sound right now if you want to open it again so here you can see shortcut is control e so if i press control e so this anonymous window will be opened automatically now if you uncheck this and by mistake if it is unchecked and you clicked on execute how to open the logs so here you can see logs are available this tab is available so the latest one is under read so i'm just double clicking on it so it will be opened and here you can see debug only will show the system dot debug result okay so this way you can just use this anonymous window so here you can write code directly you don't need to write any apex class so you will receive your results automatically right now if we go further so now we need to understand how we can create class and method in apex okay so i'm just removing this anonymous window so why we don't prefer this anonymous window because whatever code you write here it won't be saved if you log out whatever code is written over here it will be removed so what we can do instead of writing code in anonymous window we can just create a class so click on file new and then select apex class here you need to write the name so the example which i'm going to implement right now it is based on rectangle so i will be creating a rectangle class okay so here you can see public class rectangle this is available automatically so class is a keyword that is fixed predefined public means it can be excess outside like whatever is available in this class that can be accessed with other classes as well and the name of class is rectangle right now here i'm going to define a method okay so what i'm going to write public void area okay so this way i'm going to create this method now for area calculation you know we need variables so i'm creating decimal length equals to five point five and breadth equals to six so this way you can create your variables so these are variables which i am creating so i'm creating variables in this method only so this i'm defining method so this area this block will be considered as a method this whole block is a method and inside this block this statement which i'm writing so here this decimal is basically data type and length and breadth are variables okay now we need to do some calculation here so what you can do uh you can write decimal then a equals to length into breadth and then if you want to display the result so you can write system dot debug now one more thing in apex you can use single quotes only you cannot use double quotes so this way you will be writing your code okay so right now these statements are available okay so we created two variables here and one below and which is storing area calculated and this way we are displaying it okay so here i see an issue so this way you can see if there is any issue if there is any error so this way it will available so i just did a typo so that's why it is showing this error so what i need to do i just need to copy it and i can paste it right so now this error will be resolved so i just told you like whenever you save your code so it will be checking your errors automatically if there is any error so it will be identified and through the system dot debug whatever result you get you can display and if error is there you won't be able to save your code right now this code is created a class we have implemented so in this class we have one method that is area now how to run this method so what you need to do you need to create an instance so rectangle then r e c equals to new rectangle and here you can write r e c dot area and parenthesis so this way you will be able to call the method so here what we are doing we are creating instance and here what we are doing we are calling the method okay so this way you will be able to call the method now we just want to run these two statements from here from anonymous window so i'm just selecting them and clicking on execute highlighted and clicking on open logs right so i hope now you are able to see these two buttons so i'm just clicking on execute highlighted so logs will be opened and there i will be able to see the result so here you can see area is 33.0 and this was the value 5.5 and 6 so this way you can simply implement your classes and inside the class you will be having the method and inside method you will be implementing the business logic right now why i use this public so public basically i use so that if you want to call this class method into any other class so public means it will be available outside the class right so if you want to use your class method into another class so you just need to write public you can write private as well okay now this void is basically a written type so this void is a written type so just ignore it as of now later in some of the example we will be like using it in proper way so right now you need to use void for every method and public as well and this name can change like if you want to calculate parameters so you can use perimeter as a method name and then you will be able to implement so if i copy it and i want to define one more method so this way i will be able to so here i can write perimeter okay so i just need to change this p equals to 2 into length plus breadth so this way i can define multiple methods as well so here perimeter will be displayed on the ui right so this is our method one and this is our method two so this way any number of methods you will be able to implement and if you want to call this method as well so what you need to do again go to anonymous window now here now here with the same instance you will be able to call it this way so now with the same instance area will be calculated and the parameter will also be calculated right so you can just select all three statements click on execute highlighted and the new log will be open and if you click on debug only so you will see area as well as parameter right so this way you can implement two separate methods and you can call them this way right so this way i just explained you how we can create class and how we can create method method will be containing the business logic actually now one more feature is available that is basically known as constructor so basically constructor is also similar to method but the difference is a constructor name should be always same as class name then it is called and executed automatically when a class is instantiated right and we can define two types of constructor default and parameterized okay now what i am going to do if you want to have constructor in your class so i'm just copying this code and i'm going to create new class so here i'm writing rectangle with constructor right and i'm going to sorry i'm going to copy the inner part right so this code i'm copying and i'm going to paste it here okay so this is my different class uh why i paste it because i don't want to modify this code so it is separate now here i will be implementing constructor and will show you how we can use it so here you can see we are declaring this variable twice in area in parameter as well right so if you want to create your variable here so what you can do just copy this and you can paste it here and instead of filling values you can write it like this okay now from here you can remove it from here you can remove it and after this variable creation i'm going to define a method so public and that method will be constructor so constructor name will be same as class so this way i will be defining length equals to 5.5 breadth equals to 6 right so this is basically a constructor okay so now what we have we have two different methods along with constructor so i'm just removing this extra white space so that we can see all the code in single page so here we have these variables so if you create variable outside any method so those variables can be used by all the methods right so here you can see this is constructor and constructor will be called automatically that constructor will be initializing these values with 5.5 and 6 then area will be calculated and parameter will be calculated so i'm just saving this code and i'm just copying this and here i'm pasting it so name of class is rectangle with constructor so you need to write it copy it paste it here as well right now we need to run these three three statements okay because we created new class so that class name we need to use for this instance creation method name can be same so two different classes can use same methods that doesn't make any difference now i'm clicking on execute highlighted so logs are opening if i click on debug only so you can see same results are available right so we didn't provide values in the method we provided value in the constructor and constructor always runs whenever you create this instance right but while we'll be implementing real-time scenarios so we won't be using constructors much but as a developer you should know what is constructor that's why i just demonstrated it right so at the last i will show you the correct approach that we will be using frequently so that whatever i am explaining here you can just understand but later on the last approach you have to remember for always okay so i just explained default constructor now i'm going to show you how parameterized constructor work so what i'm going to do here i'm creating two parameters so decimal l and decimal b and here instead of 5.5 i'm assign assigning l and here i'm assigning b and i'm saving the code so what will happen these this constructor will be receiving values from like instance creation so from here you can pass any two values so i'm passing four five so what will happen four will go to l that will be assigned to length and five will go to b and that will be assigned to breadth and then later area and parameter will be using those two variables for calculation okay so now i'm going to run these three lines and clicking on execute highlighted so logs are opening if i click on debug only so here you can see the result so what is the difference between default and parameterized constructor so in case of default constructor always value will be same but in case of parameterized constructor whatever instance you create you can pass different values right so if you create two different instances so you can pass two different values but in case of parameter in case of default constructor values will be same right so this way i hope you understood the use of constructor so one way is to implement your code like this no constructor all the variables will be created in particular method that you are using so this is first approach which is also used commonly this is second approach where you have constructor and through constructor you are setting the values and then you are implementing the methods okay now if i go forward so we have third approach so here we need to distinguish static and non-static methods right so right now whatever methods we are creating those are non-static because we have not used any static keyword so now i'm going to copy this and i'm going to create new apex class so i'm creating rectangle static demo so this is my third class and here also i'm going to paste these two methods so i'm just copying them and here i'm going to paste it right so we have two methods no constructor right that is not required here but here i'm going to define my methods as static so this is the approach which we use frequently we create all the methods static now you might be thinking what is the reason to create method as static so if we create methods as static so those static methods you will be calling differently so i'm just saving the code and opening this anonymous window and here i'm going to write the code so i'm just copying it and pasting it here so rectangle the name of class is rectangle static demo okay so here i'm writing it rectangle static demo copying and pasting it right so okay sorry here we don't need to use it so i'm just going to show you how we'll be implementing it so i'm just copying this class name and in case of static method you need to use class name and then you can just call the methods directly use the class name and call the method directly so this is the easiest approach because when we'll be linking our apex code with trigger so in trigger basically we will be using this approach only we directly will be calling the methods we won't be creating the instance right so if you want to create instance then you need to call the method so your method should be non-static if you want to call your method directly with the name of class without creation of instance so your method should be static so now i'm selecting these two lines and clicking on execute highlighted so you will see logs are opening and if i click on debug only so here you can see same results are available so all three approaches are giving same results but the implementation way is different so here we have two methods which are non-static right i'm repeating everything so here we have two methods which are non-static if i go so how to call non-static methods this is the approach create the instance and then only through that instance you will be able to call the methods second was to create constructor to set the values and then in the method you can just apply the logic so how to call it so this is the way in the constructor you need to pass the value and then you can call the methods again here methods are non-static now this is the third approach which is used most of the time 90 code will be implemented using static methods right and here you will be calling the methods directly with the name of class okay so in trigger all the methods you will be defining static if you are writing test classes then also you will be writing static methods right so going forward everything whatever we will be implementing that we'll be implementing with the help of static keyboard right okay so if we go through the summary so what we understood right now we how now we know how to open developer console we know how to use anonymous window we know how to create apex classes apex classes with constructor apex classes with multiple methods we know the difference between static and non-static method like how to implement non-static method and how to implement static method and i explained you one example area and perimeter so now i'm going to show you one more example which is calculate simple interest so i'm going to create new file and here i'm going to show you how we can use static directly so you can write public static void and calculate now here you can write variables decimal principle let's say 50 000 then rate of interest 10 percent and time equals to three years right now if you want to calculate simple interest so again you will be creating a variable and you will be applying the formula so principle into rate of interest into time and this you need to divide by 100 so this is the formula to calculate simple interest now here if you want to show the result on the in the logs so you can use system dot debug now here you will be writing simple interest equals to then plus s i right so this is a syntax for system dot debug okay so whatever you want to display as is just as enclose it in single quotes then use a plus and then variable then again if you want to write something so again you can use it like this so we will practice it later on as well because this is the first class so here i'm just going to explain all the basics on it so i just implemented this simple interest class now i'm going to run it so if i want to run it so i'm writing simple interest then dot calculate that's it because my method is static right so if you want to call your method without instance creation without variable creation directly through the class name then your method should be static and this is the mostly used approach okay so i'm just selecting the statement and clicking on execute highlighted and here you can see logs are getting generated i'm clicking on debug only so here you can see 15 000 is the simple interest so this way result is available and it is perfectly fine so this way like whenever you have any problem so you will be implementing it in such a way now if i go to our exercise sheet so here you can see those who are new to this boot camp joining for the first time so we have this sheet and the sheet link is available in the video description you can get it from there and the sheet is having all the exercises so we are on day 32 of this boot camp so whatever i have demoed in the session listed here so you need to practice those and i have like given different scenarios that you can also implement using all three ways using static method using non-static method and using non-static along with constructor right so all three ways you need to apply so that you can strengthen your programming skills right if you want link of the sheet so i'm going to share it in the chat so i'm just pasting the link of our exercise sheet so that you can just have it and whatever we will be discussing and whatever you have to practice so for beginners this exercise sheet is very important i am getting very positive feedback about this sheet right so this is a summary that we understood in this session so if you are a beginner or intermediate so i would request please follow all the session consistently do all the practice whatever i demonstrate you in the session right and do join the telegram groups so we have two telegram groups one is for broadcasting and one is for doubts so i just pasted link of both here in the chat so you can just follow and emya java playlist link is available in the excel sheet so here is the excel sheet which is our session tracker so here you can see this link is available so from here you can get it and if you want to have the session tracker link so i am also going to share it in the chat so that you can have this so session tracker link is also important so just have it with you okay so share this information with like lots of beginners learners so that they can get benefit of this bootcamp because i don't think anyone else other than me is doing any bootcamp where we are learning everything from the beginning right so this is a great opportunity for you and initially sessions will be very easy but later on it will get difficult so if you follow all the sessions properly and do all the practice so you will be able to understand the things properly okay so now i open the forum for you if you have any question you can just ask those questions in the chat and if you have asked question earlier as well so please you can paste again because i have a long chat today so just just paste okay so there is one question do we need to know oops concept from java so in tomorrow's session as you can see as you can see in the sheet so in tomorrow's session i will be discussing about the object-oriented programming features and i will be discussing about the data types right so we will be focusing on data types tomorrow as well as oops concepts okay so sk saying good session miss some previous session so no worries all the previous session links are available here so this session tracker is having everything right and it will remain live forever yes sam if you complete that playlist so you will be understanding things very well so just do this so if you talk about external libraries yes in lwc we can import so nishant is asking please explain constructor so here i have explained the constructor so this is the constructor nishant and constructor basically runs automatically whenever we create instance so at this line whenever this line will be executing constructor will be running automatically and this four and five will be assigned to this lb and l and b will be assigned to length and breadth so those who are beginners don't worry don't say i'm a fresher i'm a beginner i know if you're a beginner you need to do lots of practice and you can see i just started from the very beginning right so you just need to implement you need to understand because these are simple mathematical calculations you just need to follow the syntax and you can see in all the example syntax is same you need to have a class class name then public static void is same you need to have a method name then this logic you need to write as per the requirement so as you do more and more practice you will be able to understand so divya constructor basically we use to initialize values so here we have two variables length and breadth so if you want to initialize values into these two variables so from anonymous window here you can see we are passing these two values four and five and these values are going to l and b and through l and b we are assigning them into length and breadth so these length and breadth are class variable which are accessible here in area as well as in perimeter method okay so sachin is asking why do we create instance of the class so instance of the class we create so that we can call the method if you want to call the method so we have two ways one to call it through instance another to call it through class name if you want to call it through class name so you need to define it as static yes robin admin portion is necessary for development no main method is not required in epics so deepak scope is local here like yeah for instance variable that we created in constructor that those can be accessible by any method and we didn't discuss about static variable we discussed about static method yeah so ashok is asking i am saying constructor executed automatically so you can see with this instance like i am not calling that constructor it is executed automatically i am not calling it like this similar to method so methods i am calling but i am not calling constructor like this satya no in real time we don't use constructor for static method no we cannot combine static and parameter as constructor thank you vk so java playlist you can see side by side thank you praveen so i would request everybody to do practice whatever i explained today and just try to discuss these things in the telegram group right because these are very basic things classes like people are asking what is class so basically if you see here class is a container class is a container for methods in apex if you want to define any method so you need to define a class now you say what is method so method is a block where you write a business logic so if you have more than one business logic so you will be having two methods if you have three logic three methods will be there and all these methods will be enclosed in the class thank you deepak for appreciating yes yes yes there is another way to execute we have triggers so right now we are just begin the learning so that's why this we are executing through anonymous window so later on we will be calling these methods through trigger so just have faith in me after four five weeks you will be able to understand everything clearly right so don't have panic believe in me this is first class do practice just understand the terminology don't think about the future right so whatever i just explained just focus on that so that you can understand the things right and i'm sure if you do regular practice if you will be consistent so you will be able to understand the things right and i'm happy to see like in my this is my 32 number session and i can see more than 1000 views i got to this session and this is huge and you can see concurrent viewers are more than 200 so this makes this bootcamp or success and i'm very happy and you can see lots of people joined regularly like those are available here so i'm happy like people are joining and learning and the way i explained today's session all the session will be explained in the same way in the detail and i will be demonstrating each and everything in detail to you so have faith in me and follow the session properly so here you can see excel sheet is available and all the sessions are already listed here so you can see whole three weeks plan is there so week by week day by day we will be doing all the practice i will be explaining all the theoretical concepts along with the demonstration will give you exercises as well so if you do those you will be able to understand things quite well right so i'm doing lots of efforts for the whole community so if you believe in me then you can join the sessions on daily basis if not then it is your choice i can't force but sessions will be happening throughout the year so if you want to join be regular if you are not regular then i can't help right because everything is connected so if like i i don't think anybody in paid course also won't be able to explain things in such details so if you want to understand if you have the opportunity to learn these things for free of cost so just utilize and grab this and i i just post one lingdon post where i told everybody like i learned development at zero cost myself but you have the opportunity like someone on daily basis teaching coding to you so i think this is a huge opportunity for you right and you never know when there will be an opportunity for job and if you are already doing a job so you just need to know the all the basic concept so that you can excel on the projects right so i can say this much and do practice and i hope in tomorrow's session whenever you will be doing practice you will have some questions so i will be answering those questions as well so just share this link sanjay gupta tech school youtube channel and soon you will see this channel will become the leading channel because everything i am delivering free of cost and other boot camps will be happening in the same style so we will be having the whole session planned day wise and different trainers will be coming on this platform and they will be sharing their knowledge with you right so i don't think anybody else is doing this in technical world yeah everything pratik everything i will be explaining so i already told you like excel sheet is there so with this like i just want to say thank you everybody like you joined today's session and made this session a success and i request everybody to join sessions on daily basis so that you can understand more and more and all the sessions will be recorded recordings will be available in the excel sheet so anytime if you want to revise the things you can just go through the recording okay so thank you so much you took your time and listen to me for more than one hour so i'm happy like so much learners are learning sales force free of cost and i'm able to create a lot of like consultants for this ecosystem so that whenever there will be lots of job available or like recently like jobs are available i can see cab germany is going to hire some freshers and experience candidates so like keep an eye on linkedin there are opportunities available so if you are good with the programming then only you can crack the development role and we have a project as well so all the development stuff we will be doing with that project okay so if you have not completed that project recruitment application so that project is available at these sessions like day 16 to 21 so those who are new to this bootcamp join through development only so we will be continuing this project only which is adamant project so in this sheet it is available day 16 and you can see at row number four sales force project link is also available so you can just go through this link and start implementing everything i explained in these six sessions so if you have not followed so you can just implement this right so just just share this information with everybody so that people can utilize this opportunity okay guys so if you want to drop off you can thank you so much and i will be online for five more minutes so that if anybody is having any question otherwise you can leave and i will be providing tomorrow's link here in the sheet soon and link will be shared on the telegram group channel instagram linkedin everywhere right so you can just follow and don't forget to practice this if you are a beginner right and today's session link is available here as well so just practice everything if you have any difficulty just go through the recording everything is available free of cost you just need to do two things you need to do consistent practice and you need to find some time if you are able to do these two things you will be able to learn coding okay and don't think you yourself is doing i'm also doing this with you so i'm doing content creation consistently and i am finding time for you so that i can deliver this so if i can do without any reason so you have a reason so you can do that for sure so aparna we will be discussing function of class in upcoming session so you will be able to understand so today just implement whatever i explained so tomorrow i will be explaining oops concepts so i will try to have more theoretical content related to oops concept so that you can understand yes vivi babu you can continue so ashok can you ask your question again yes divya i explained in depth i don't i can't go beyond this because otherwise it will take a lot to complete this boot camp so i i tried to explain everything in detail so just go through the recording listen everything patiently you will be able to understand so wishmberg just ask this question in the telegram group yes satya integration will be covered thank you mary thank you good to see you in the session so sandhya admin certification preparation if you want to do i just did a session on that and i can plan more sessions for interview prep as well so why we execute anonymous windows so that we can run our class methods if you want to run your class methods so you need to run them through execute anonymous window thank you deepak thank you shashi so dhira just practice i will be recapping everything what i explained today tomorrow as well so just do practice so don't worry about constructor we won't be using constructor much if you didn't understand you can just forget it you can just remember what is the purpose of constructor right or if you want to learn it more so maybe in tomorrow's example i will have one more time constructor so that you can understand it more clearly so system.debug is important so that we can show the results like if you want to show the value because right now we did everything in the back end we didn't connected our apex with the front end so if you want to see the results so for that purpose you need to use system.debug thank you vishambhar Rajesh yeah you can just give it a try if you get a job that is good thank you bharti thank you aparna thank you so much for believing in my sessions yes ashwaraj we can fetch custom labels so you can find something on google like how to fetch custom labels so deepak if you want to have confidence like this is first session and you are saying you are not getting confidence so if you are implementing something then on then you can say you didn't try and you are saying i'm not getting confidence so you won't be having do practice first do practice follow for at least two three weeks you will be having confidence through practice you will have the confidence yes ankur everything will be covered we will be doing apex testing as well thank you sikander yes gharat so soon day by day you will have more confidence thank you ram charan thank you rajesh so i think now i can just take a leaf i can see loads lots of folks attended the sessions so i just want to take a screenshot so that i can share it with everybody okay so thank you so much for joining this session and i hope you understood lots of things through this session so thank you and see you tomorrow