Sei sulla pagina 1di 526
SOLUTIONS ‘Training +Coneuliing-Develepnent Capital info slesfbreg com INDEX S.NO TOPIC NAME PAGENO 1. When Should I Use Apex Ad 1 2. How Does Apex Work (oe YW 2 Object Oriented Programming (Oops) 3. Data Types & 3 4. Class 3 5. Access Modifiers 6 6. Class Variables 8 7. Object Np 9 8. Constructors SaC* 10 9. Usage of Aj {Petam With in 7 VE Paj RN 10. aero the Apex Class Sy fage : 12 CBS for Getter Method 13 12. Apex Class to Demonstrate Setter Method 14 13. Call Apex Methods in A VF Page 15 14. Simple Apex Class 16 15. Array 17 Shyamala Plaza, Opp. Annapurna Block Behind Huda Maitrivanam Ameerpet,Hyderabad-16 040-66028688, +91 86 86 86 42 86. www.capitalinfosol.com capitalinfosol@gmai.com G Capital info SOLUTIONS Training -Gonaulting “Development 16. Pick List Using Select Option from Apex : 18 17. Collection © List 20 © Set 24 * Map 27 18. SOQL Queries 32 19. Child to Parent Relationship On Standard, Custom Objects 40 20. Example Program 4l 21. Parent to Child Relationship is On Standard, Custom Objects 43 22,SOSL Queries ~~ 7 46 23. Email ger > 49 . Cup e 50 PDI 54 . yun ail : 53 2 62 25. Interface itor . 67 26. Interface Iterable 70 27. Database. QueryLocator Class 2 28. Batch Apex B © Start Method « Execute Method ¢ Finish Method 29. Invoking Of Batch Apex Job B Shyamala Plaza, Opp. Annapurna Black Behind Huda Maitrivanam Ameerpet,Hyderabad-16 040-66028688, +91 86 86 86 42 86. www capitalinfosol.com capitalinfosol@gmai.com a f . on Capitolins sro 30. Order Of Execution Of Batch Apex Job 8 31. Database.Stateful 81 32. Governing Limits, Limitations 83 33. Apex Scheduler 84 34. Real Time use cases for Batch, Schedule Apex &%& 89 aes 34. Testing 100 35. Batch Apex Example With Test Case € Ww 106 36. Schedule Apex Example With Test Cas; SS 107 37. Triggers & Examples by 109 38. Invokong Apex methods in THES) 124 39.Recursive Triggers eS 127 40. Order of Execution KL ers 131 41. Future ao 139 42. Apex Sharig > 142 43. Flowstition 146 > ‘Ocess.Plugin Interface Input parameters ‘e Output Parameters oS Plug in Program 150 45. Select Option 154 46. Schema Programming 156 47. ISON(JavaScript Object Notation) 167 48. http Callouts 180 49. JQUERY 183 ‘Shyamala Plaza, Opp. Annapurna Block Behind Huda Maitrivanam Ameerpet,Hyderabad-16 040-66028688, +91 86 86 86 42 86. www.capitalinfosol.com capitalinfosol@gmai.com G Capital fe ag [info slesforcecony 50. Introduction to VisualForce Page 189 51. Apex Components 190 © Apex Page © Formula & Expressions in VF © Apex PageBiock © Formula Expressions © PageBlock Section © PageBlock Buttons © Command Button © Command Link © PageBlock Section Item 52. ApexInput Components 197 © Input Text e Input Secret ¢ Input Hidden Input Checkbox 53. Java Script in VF Page 205 © Introduction to Java Script © Arrays in Java Script © Methods in Java Script © Reading Sobject data in Java Script © Reading VF input component data in Java Script © Validations in Java Script 54, Page Block Table 217 Shyamala Plaza, Opp. Annapurna Block Behind Huda Maitrivanam Ameerpet,Hyderabad-16 (040-66028688, +91 86 86 86 42 86. italingc capitalinfosol@gmai.com Capital info ales oe Ca saleene cont oa ‘Training= Consulting “Development 55. Data Table 223 56. Data List 224 57.Apex Tab 226 58. Insert & Include 229 59. VF Page in PDF Format 60. Action function, Action Region, Action Support Oo 61. Real Time Scenarios 240 62. Reports & Dashboards in VF io” 249 63..Google Maps in Salesforce df 256 64. CSS de® 261 65. Remote Method invocation Java 270 mg wT NY em Ww) Shyamala Plaza, Opp. Annapurna Block Behind Huda Maitrivanam Ameerpet,Hyderabad-16 040-66028688, +91 86 86 86 42 86. www..capitalinfosol.com capitalinfosol@gmai.com CAPITAL INFO SOLUTIONS Shymala plaza, Behind HUDA Maitrivanam, Ameerpet, Hyderabad, 8686864286, 040-66028688. capitalinfosol@gmail.com www.capitalinfosol.com “Only Capital Info Solutions Students Can Answer These Questions” SALESFORCEcrm InrerviewQuestions BySatishMyla 1) Visualforce Basic Questions : ‘What is view state in visual force ? Which api used to design visual force page? ‘What is the difference between actionSupport and actionFunction ‘What is the actionRegion? What is difference between insert and include? How do you use static resource in VF page? ‘What is remote action? How many records we can print a pageBlock 9. What is the difference between related List enhanced List detail 10. What is the difference between controller and extension? 11, What is Ajax? Have you used it 7f so tel the scenario ? 12, What is Jquery ? Where you have used ? 13, What is S-Controls 7 14, What is the use Static Resource in Visual force? 15, Can I pass parameters from VF page to apex method? 16, How do you refer to current page id 17. Tell me something $Action PA eee BY Satishtayla 18.How do you embed Google map in visual force? 19.How do you pass the parameters from page to page ? 20. What are custom components? 21.How do you make a VF page available for Salesforcel . 22.How to use Sforce connection ? 23.What is custom component 7 24.How to inplementautoLookup and query from VF pages ? 2) Apex fundamentais 1, What is Apex ? 2. What API is used in the apex? 3. What are the access modifiers in the apex? 4. What is the difference between With Sharing and Without Sharing ? 5. What is a constructor? 6. What is the use of the static variables? 7. What are reference variables in apex? 8. What are Sobjects? 9. What is the difference between List and Set? 10. What is Map in apex? 11. Can we have duplicate Keys in Map 12, How many objects we can store in list ? 13, What are setter and getter methods? 14, How do you refer to current page id in apex? 15. How to do you invoke standard actions in apex class? 16. What is page reference? 17. How do you pass the parameters from on apex class to another to another? 18, What is virtual class? 19, What is interface? 20. What is abstract class? 21, What is overloading? 22. What is overriding? 23,When we invoke with sharing method in without sharing class Now method is Executed as? 24,Will the inner class inherits the sharing properties of outer class? 25,Base class is declared as With Sharing and Derived class is declared as without Sharing what will happen? 26.Can I have constructor with parameters in apex? 27.Dereferncing a Null pointer value error? 28. Variable is not available? 29:T00 many Records :10001 By Satishivayla 3) 4) BY Batch Apex and Schedule apex questions. What are the Soq] limitations in apex? ‘What are transaction limits in apex? ‘What is the need of batch apex? What is Database. Batchable interface? Define the methodsin Batchable interface? ‘What is purpose of Start method in batch apex? What is the Database.QueryLocator ? What is the Iterable ? How to define the custom Iterable? ). What is the use of execute method? 11, How many times execute method is called? 12. What is scope of execute method? 13. Can we call callouts from batch apex? 14, Can we call another batch apex from batch apex? 15. How many callouts we can call in batch apex? 16. If you get Callouts Governing limits error how do you rectify? 17. Batch is synchronous or Asynchronous operations? 18, How to synchronize the batch apex? 19. How do you call batch apex from the batch apex in earlier versions of API 26.0? 20. What all the general errors/ exception we will get in executing batch apex? 21. What is the maximum size of the batch and minimum size of the batch? 22, Tell some of the scenario’s that you have developed using batch apex? 23. What is Database BatchableContext ? 24, How to track the details of the current running Batch using BatchableContext? 25. How many batch jobs can be added to queue? 26. What is Database.Statefull interface 27. What is Database. AllowCallouts 28. Why should we call Database.execute() and future methods in Test.startTest() and Test. StopTest() 29. What is ASyncApexJob object? 30. When a BatchApexWorker record is created? SeSPNAweY NH Schedule Apex ‘What is Schedule apex? How many ways we can schedule the batch apex? ‘What is Schedulable interface? What is the order of execution? How can we schedule the batch apex? yeep SatishMayla 6. How many schedule jobs we can schedule at a time? 7. What is cronTrigger? 8. How to identify the jobs next schedule? 9, What is the difference between Synchronous and Asynchronous jobs 10, How many future calls we can make in aday? LL. What is the difference between manual schedule and apex schedule? 12. What is the best scenario that you have designed using schedule apex? 13, How to invoke asynchronous cailouis irsciredule apex? 14, Can we call synchronous callouts in Schedule apex? 15. What are the problems that you have encountered while using schedule apex? 5) Triggers: 1, What js trigger? 2. What are differenttypes of Triggers in sfc? 3. What areTrigger Context variable? 4, What is the difference between Trigger. New and Trigger. NewMap 5. Whatis the difference betweenTrigger.New and Trigger.old 6. What is the difference between and Trigger.New and Trigger.Old in update Triggers 7. Can we call the Batchapex from the trigger? 8, What are the problems you have encountered when calling batch apex from the trigger. 9. Can we call the callouts from triggers? 10, What are the problems that you encountered while calling apex callouts in triggers. 11, What is the recursive triggers? 12. What is bulkifying triggers? 43, What is the use of fuure methods in triggers? 14, What is the order of executing the trigger apex? 15, What is trigger handler? 16. How do you avoid recursive triggers? 17, How many triggers we can define ona object? 18. Can we define two triggers with with same event on single object 19. Tell me some scenarios’ where you have written the triggers? 20. What is the best scenario that you have developed on triggers? 21. How many time workflow filed update will be called in triggers? 22, When are the rollup summary fields are calculated 7 6. WebServices: J. What is the difference between HTTP1.0 and HTTP 2.0 2. Difference between REST API and SOAP API? By SatishMayla 8, In how many ways we can deploy the code from sandbox to production? 9, What all the problems that you have when we are deploying ? 10, What should you use command based deployment 8.Flow and Plugins 1.What are visualflows ? 2.How to define custom wizards? —S3:How-wintegrate visualflows to visualforce page ? 4, What is process.plugin S.How to call webservices from Flows (6.What are the updates on flows in winter 15 9.Custom Setting 1.What are custom settings ? 2.What are different types of custom setting ? 3.When to use Custom Setting and Custom Labels 4.What are global actions ? 10.Mailing Concepts What is the difference between SingleEmailMessage and MassEmail Message ‘2.Mow to pass the VF page as PDF in Email 3.what is TargerObject Id 4.What is the difference between whold and what Id By SatishMayla What do you mean by statefull? How many types of WSDL we have in salesforve? What is the difference between Enterprise ,Partner WSDL? What is difference between Webservice and Callouts? ‘What is the use of Metadata API? How to fetch data from another Salesforce instance using API? 9. What the annotations in salesforce? 10. In How many ways we get the session id using SOAP API? 11, Can we use Http callouts in SOAP API? 12. How to pass the session in REST API? 13. How many ways we can provide security in REST API? 14, What is diffenectbetween OAuth 1.0 and OAuth2.0? 15. How many ways we cam specify the Request Header in REST API to getaccesstoken? 16. What types of response you have taken from the extemal server? 17. Can we call any resource from external server using url? 18. What is future annotation ? 19. Did you work with heroku? 20. By default webservices are synchronus/asynchronous ? 21. Have you worked in Siebel to Salesforce data Migration? 22, How to implement Salesforce to Salesforce connection? 23. How to call Apex method from a Custom Button? 24, Have you worked in integrating Google chart? 25. What is Meta Data API 26. What is the use of Tooling API 27. What is the use of Apex WSDL 28, How to create 2 new Custom Object usingwebservices? 29. How to create a new Custom Fields /Workflows using webservices? 30. How to connect Microsoft excel to Salesforce ? 31. Data migration using third party tools like Informatica cloud ? 32. Did you use any email campaign services ? Sr avew 7. Deployment and Change Sets : 1, What are the diffent types of changesets ? . How to create a sandbox ? How many times we can refresh a(configuration /develope/full) Which things we can not pass using the change sets to production? ‘Can we move the record types using the change sets to production? Can we move approval using change sets to production? Can we move role /users/profiles using change set to production? eR sows By SatishMayla ee ee Apex. AN a Apex iga@ Stvongly typed abjoct osiented propoamimin? language | ~> Tt allows the developers to exceute flows and transaction | Contsol Statements. —> Apex exables Pauelepess to add business logic to most sygter ewents lire batten clicks deleted vecoud updates ard yisualfekee - wS —> Apex fos \\ 4) Dpteguated \- Gt prides bale mares ONL alls, 1) Slane calesfefee ebiect qercry wets ) w Bay 40 UN2,.€0- f y Eaay to test. S W) Uexsion od ul) Multi tenant augye a When Should i seg ABI STO Croate extail Sorniee > Cooate websasvices , | ~ Pastor complex. valtdation ove taultiple ebiets, | > PT create Grmpler. business prccestes that ove nok euppdted by wort How. — Create custom toansaction logic. > Attach custory toni to anothers opesatitn. a DATUM MER AM HRARAM ANA Aran Aner egRge SOC CCC TSE TTC TTT TT TTT ee ccc rere cvccesssetases “yete YY Pauw | (as947Od ; : ” @4 , , oe Gp 00 € ee 2 wer 5 ; Wok ¢- ae A Apex, progeamrs suns entiaely ON —damand on Fowe-con How does A: Platform. —> Fiset the platform application Sasves Compiles the cede into ie abstoact Set of Tnetsuctions that ain be cerdasgctocd by Ager dantime Intespates. —> Tho Compile cede IS Stoxed to rretadota. > When the ere cata tagqeas the cxecedlion of apex by click button 3d) visualtsco the application Serunry Tebsionse tho Cornpiled inatouctions fromm tho Ywetadata and send trom to Suniime Mksprotes below retersring the ek SP Qbieot Oxionted programming (Cops):- Ye cop (object Osientec] pregrarnming) 1s a eenleay tha provider a | ot yradulaaising psograun oe “ rg partitioned mervony arco. $8 tot date and mathadb HWA MD be ted as tersplate Ph | Creating copia of Such wares ects) on dayrard. unlit procdwral prgrorrnitg hase in tho cop proprarnsiny vmadeh, programs. gro Bianiged ascend obiecke and dala mothers thay action and logic. athe main cof pitinciples axe Eneapsulation Eptenitarce : Polyrrexphisen. Eneaptulation tre hapting «ap of data ard ertheds togstheg is called encapsulation. poh oxampe, PF ne tage AUK, Ne naite tho. vasiables and methade inside the class. ‘thug : clase ts birding tham togethea . $0 cage 18 AK Cxarmpk fd encapsulation, Tbesitance - Fe coales en clases Fsora exisigting chyses So rat rhe rein clones will acquine bl the features éf the cessing clases, is called Inhesitance. i A god ecanpe £3 Frfesitance tn rature. is pasenis prcducing the ebildvon and chien Thesiting the gpetitien Of the paxsents. Polgensphic nn :- Polyraesphien) sepresents One flr in Ynubtiple Powys. Do programming 1 Ke con use a ginge ugusiabe to yeas to objects of diffesent typ aud Tag *) Ug thot \awiable ho call the methods of Gifferant Sebiees * a yrotied @ | call, con pesforrn different tagee da ing Pathe type of the chet YY ‘ Apex furdamentale gay ~ bas Dato. type \- ‘ of} Dato. type 9 tha, Ape, felle“ebodt What type of deta can be toned . . o > Whakis the saxty ofthe data that cain be Stosed- » 9 4) premiitittedaiautyp i) collections At) Enurme 1) Prernitive data types +- “these ase. the cata types which are predefinad by the Apex. Sager eur —> A Prernitive dota types Such as an Totegus , Double Ler, Pate, Pode me, String , 10 3 Bookan, CHP ORHHOHROOAEREEHOHEOOOEAEEHOHAHAAHS OH ROOROORD eee ree er caer ee eee ae eS eee ee eee BEE we EE EEE UE CEO EEUU AS —> All poemitiva. chto types o&« pasted by ualtas not by tefexance A Apex vasiiables , shathars thoy 10 class member Vosmableg pase ‘witialized 10 vull. Make suse that Le inital’ vousiables to appwopaicde Valuos befose sing tham Apex premitive chbatypes include Boolean A valuo Hat an only be cunigred tous (ale, reall Eq: Boolean isActive=palse; ov yf Doe A uakie Hhot indicate, o. pavrticulasy @ value Contain no ‘infosmation abst time «Date raat" odsoaye be created With & Systern State matted. Sqr Dato mypate =Date. oe 05/15) outpet ebay Sa 19 09.00.00 Time and DateTime & eripie” ane date types associated with cates and’ timag along ¢ “Date dota. type, the Heme dodo. type. Stosey times (hows, wile Secon! and yrillicecords). the Date hte +4. Gfovex. datos C¥ecun tmonth and dass) . the Cote time chtattypa: Gtosea both dates and times ath ob there clages hag a testnstance method pith cadich uor Can Constiuct Pasiticulas dato and time ales. Ege Time tt = new Tnetance (tq; 20)! 2°); ofp B 14:20:01 Apex 2 — be an also create cates ard tinus trom tte cuxsent lock , Date my = Datetime non); Pate += Date today): — > The date ard tne classes alro have instance matheds Conuesting from one format to anethas . FQ: Tima tg= Date tine. Pomc). mec) — 5 We can alto rranipulte the values by Svstance metheds. EQ: Dabo tS = Iate-toda a Tnteguaytong, Boutleeand bec: Pecimal 4 TO Stove nemenic values ‘my Maiablesi dicht,, \nviables caith one Of the nurresie data. types, Integes, 1299, Double ard Decimal. Thteges = A g2-bit oumbes that docin't irclucla a chaciveal pont Tk howe Q minimum Value Of -2, (47,483,648 and a Maxime Value of & 14, 48s, OF Egy Thkegeys tcl SAA OP P9999 ernveve SOPRA HEHEHE ZEMEOEOHELOEOREe Hee EE CEE EE OEE ERED Ew eee EE ED [pe a Ag Clase ica Cellection of datarmembeays and Tothede. ts a Stuclant oe mo; *) there ane chtarnembeag ch Sting yon; ‘tho ckagg . Public void geldetatls( ) Kn t > Thig Teethp>ratbea Gyetern.cebug (sollmn'! tno); * Aiea . Sygteiny . debug ( treme); gst 9 (rare lS 5 Q 5 ’ rr class Ermployee f ew Totegug OP.” > { > Yariabley Heatomerntnss Gteing depastinent of the clage \woid gheeoc) { —sHethod of { [/uvite the loge the clay . § so dafina an Apex class tpacify the 4ellorwing. 0 Accoss modifiers t- —> You must use oe Of the access radifiesns 48 top leual clay. (public d.global) —s you. do not hau £0 se, access readifieas ny the declaration af inner charcey . nN) optional cefinition road rreag sucha e soyntat = sivate| pedlic Gest fabstract-| with shaving | =e = CPP P HOHE O ROTOR O RRO HACE RIED EERO OPS PPO 9OS DRS eb ee meee ee ae Cee eee ESSE SESE SEES SUR CETTITUTUTT i AS Accossmodifioss - 1) private t- Tf you declare a clase @ private itis only Enon to th Bleck ip tobich it ie declaved. — By default all tre inros claced axe private, &) public! TP you declare clas ax, a public , thig Clase ie visible thicugheut ir application and you can access ial 3) glotal- @ you dkew a Sos Bc. chat ie isible to oll the apex. oo application A outside the application: c & Note Pa wetbed Fh acne daclaw a2 global then the top lea cae aly aye dslaned ag global. hy With Shaxing as. declare a charg ae a ith ehasing , Sing valet Jide to tho. cusyont ugers, will be taken into the Comiderration and the Ujer con aceore & paifdinn the operations | basad-6n tho pagmistione Guan to bir on Objecte & felde. Gris euch socuanity , Shaxing suleg’) . 5) Without Shawsing- UF yor declaw a cag as a. bithout choving, than this apex clag mune inn cyctonn made Abich Tocang pat coda Fag accert to all the obincls ard fiekde ToTegpective of Camrort tHe3$ chasing geiles , Field lenel Cacteaity , cBhiect peumigsions. Notes -1y AP the class ie net chclared ag With sharing & without shaxing thon, by the claw is by dofault taten ag &) Bath tres classed and cutes claed can te declawed ag Witnsharing, 3) TP invesclae is declared ag a and topleual clase ig Geclayed ag blithout Shaoxing ive. SO" Widhrwn in With sharing pe! ky Pa claw ig not declared as +thig class 1S called by =a thon both the claseeg sen SAYS 5) Ovkeaclaa ik docked ag va ary ond innan clage i¢ declaxed 0 ving ig “thon imnas clay sung i Hithout Hagin reontixr' onli. (Inne classer don't take the Pacpestiea (crating propusties ) oops, cube class) 8) \istual 1-79 Clow is decked ith fayeoSd uistual Fhe thic clas can te extended (Inherited) & this clas, mothede Cain be ovessicder by taving a cla allad ouesnidden, Meh > ig os D Abstsact - this clay contains Abstsact methads. fe ze ee POPPePrepeR, LO@ #o pops SO ROD aes PPP POSenrenen Flertiis. site Al qr bablie clay otwtericloss jfccde clay, woaschssx § as V Trragclax cele Oo c OY 4 Qo 4 Eger pubic with Shasing clay shasiny [ecko 3 Egat Peablic. -Hithowl Shaxing clay noshasing FP Yeoka & ede eeceee sees esis ebb sb bss I IUUTUTUITIITUIa Br public With Sroxing clasa Cutess /[/ cute Cay, coho cSthout Shaning class, imag I trvmey dost code ry Dh the above axle cubes nt Chasing sales. Butsin 2a, Rage th Syste context. ag public ot she =D ys custerg Etre si Sharing clay imex, \\Sores clay code g 3 Qn this both res, and cudeg clager Teens with CHPFeNF Usese pesmissions. Sse rere reee perece ek@ee eae eee LLM as sae bee Seeree o Se eee sche ee esis sislLinnnnnihhiT A$ Class Uoxniobles - the Unsiabler in the Class Shocekt Specify the folloaing pocpersticg cohen they ona dafined. 1) Optiomalsmmadificas such a3 public © final 0% usell ag Static. i) Requived < the dain type of the Vaeriable ; cuchag tsing 0 Boolean. ain “i optional + The vokw of the Vosiable Vo | ‘Wy optional the mame of tha \iasiable A Syntax /- fy [ pabic [private | Protected [glo [static] Cota _ type. jable—narng : wy priate Seog heal Erteqn hy_anr; Private Fira tegen 42h clay, Methods! yo doPtnn a methed spectty the tollecoirg ‘optional : Madifiers such ag public os protected. te) Raqusised ; the late type of the Uaeg vetteoned by the matind , Such a5 String DBotegay ke void iP the Trethed oes, not return a value. WW) Requised «A list af input Pararrcterse {the methed , seporoted by Comprar, Cach prececled by its cloto.tye, ad enclosed im. parentheses ¢).2F there ase To parameters , Lye @ Sak of exepty parenthare, A wathed can only haue 82 input pasarnetears, ‘uy pogpeived + The becky of tho methed, enclosed in braces f % ALL tho cece $& the reethed including ony local Uausiodle declarations, is Conaired hese. Sxyptac- Cpublc private | protectad|gloto! ) Couessridga, ([stotic} data _ type methed_nawe Cinpet nngfags f YY a, % \\the beady of the mete. mS aa Stake oh : ~~ A DotwUsy, “NYSENT ee BQr public closa Example fake Sopa shea rep of) Sastorn dain Cg age ic" 4092); 5 g aPeeee re preenre r LHS PHHHOHOHRATHMAHEHIHTSHIGIO DS adh eh Re epb dau ddan ae i ese eee EE LETC Tae eeese e Ge secesd i Objec + 4 object is a ingtarce of the cla. This has both State and behavioeu > Moony 43 tho dotarrembess ane allocated only chan You Create a object Syntax’ Closerawe objectrame= nan clagromna()¢ | | | al > “this the rayne oY : NYY of clan $M Lola ee GX dune Creating Qn obitct. By class Example \\cede ¢ g Example ¢ = an Exarmple( ); Dastacictos GFestouctdy 16 a Special wwothed whch hare the following Peryeatios. 4) Method nome will be sarme ag clays. ity Accogespeci fies, evil bo puutlic . Vil) this roathed call invoted only once that is at the. fine of Creaking an cbiect - iy this i¢ Used to Tntlantiate the dato. membass of the class, Ae ~ pubic clagg Testobieck \Vthe m0 aaqurnent Conttsuctos Public Tetobiect( > w= NO $ &. ~*~ Those Ge 3 typey nv ow , Default Consteug SN A “ 2) Non ~pohobed conc 9 rebated stat A ee cla Example Example ¢ = Teh Exampe ¢); x deegn't Contain any Construct) then Aper, Corns by default Creates o.deermny Constructd} on the Tame of cla johon eee create oh object $b the clagg. 9 98 e COP TOP rererareeeccorone “@ i s@ @ so @ > “® > > > ® a » “. > » J . Ayo Tm the above Cxarnple, the apex class dootn't Contain any Constauctd) « 80 Khan coe cxeade abiect th Etasmple cla the Apex Comfilary cxeates adofault Conrtwuctts, “tr public exarmplec) g g ae 2) Non- poxaxnetetised A Comnshaucts f pass tnt: 7 Trisa constsuictdyceesn't ee tess, oF Constructs) | Er public clase Example mes cy ¢ Toteges, mo, Steing Nate; S Re exer oe String myname) > -a7areteaized , Com are; tudor Tame = Yoynaine, A spublic Example (> pavse; | —> This 1S MEN - powarnetasized IMteede vere sain | Conttyuctor. Wisite a. Ape proguam to demonstrate “age of Gnstructd. 1) Open daualoper Console crdas, by clicking the ame on the 9) dick File & select Apex class. 3) Entei the closg rome. hy Wisite tho Apo clays : Public dass, employee Stein Crmployge naxne ; . ntegus, Erployee ao; Peublic Emmployeet ‘ i aA Ermploeeticemne “= Oxi!» Employee No 2 10; ; ; sD, “oy Public Void Shoot > t * Sytem dabug ( ‘Erployeevama i '+Erplagenarnt)); ~Siptemm clebug ( 'Enplogeento uy? + employer); 5 5 freee rerericee . e SOPHHOHRMPMEOP OD

Potrebbero piacerti anche