Do you know the getter and setter methods?



Do you know the getter and setter methods?..

Answer / Tulika Srivastava

Getter and Setter methods are used in Object-Oriented Programming (OOP) to provide a controlled way of accessing and modifying private or protected variables within a class. A Getter method, also known as an accessor, returns the value of a variable, while a Setter method, also known as a mutator, sets the value of a variable. In Salesforce Apex, getters and setters are often used to encapsulate data and follow best practices for object-oriented design.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

Validation rules, what are they use for in salesforce?

1 Answers  


Difference between isblank and isnull?

1 Answers   Cognizant,


How to do callout integration? : salesforce integration

1 Answers  


List things that can be customized on page layouts?

1 Answers  


Mention changing what may cause data loss?

1 Answers  


What are the different methods of batch apex class?

1 Answers  


What are the types of soql statements in salesforce? : salesforce integration

1 Answers  


What is cloud computing security?

1 Answers  


What is a difference between System log and debug log?

1 Answers   Cognizant,


What is salesforce environment?

1 Answers  


What is the difference between custom controller and extension in salesforce?

1 Answers  


Highlight differences between sosl and soql.

1 Answers  


Categories