The instance of class is called Object. According to Salesforce, object could be of class or you could create an object of sObject as well.
The object of class can be created as in Java or other object oriented programming language.
The below example shows Class called MyClass:
sObjects are the objects of Salesforce in which you can store the data.
For example, Account, Contact, etc. are custom objects. You could create object instances of these sObjects.
The below example shows the initialization of sObject and how the field of that particular object using dot notation can be accessed and assign the values to fields.
When a class is loaded Static methods and variables are initialized only once.The Static variables aren't transmitted as part of the view state for a Visualforce page.
The below example shows the Static method and Static variable.
The Static variable value will be same within same execution context and any class, trigger or code which is executing could refer it and prevent the recursion.
The Static variables will be instantiated only once when class is loaded to avoid the trigger recursion.
Apex Related Interview Questions
|Web Services Interview Questions||AJAX Interview Questions|
|Salesforce Admin Interview Questions||Salesforce Developer Interview Questions|
|Server Load Balancing Interview Questions||Oracle Apex Interview Questions|
|Visualforce Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.