Apex

Why Mutating SObject Keys in Maps Can Cause Null Values in Apex.

In Apex, a Map is an essential data structure that stores key-value pairs internally by hash codes. When retrieving a value using the get method, the Map uses the hash code to determine the correct area in storage to search for the value. However, if you modify the hash code of the key, the value cannot be found in the original bucket, resulting in lost data within the Map.

Why Mutating SObject Keys in Maps Can Cause Null Values in Apex. Read More »

Salesforce Interview Questions – Future Method

In this article, we will explore some of the important future method related interview questions and answers.

Q.1: What is Future Method and Why it is used?
Ans: Future method is a form of asynchronous apex. It is run in separate thread when resources are available.It is used to run long running operations like external web service callouts or any task that can be completed in near future.We can only pass primitive data types, arrays of primitive data types, or collections of primitive data types as parameters. 

Salesforce Interview Questions – Future Method Read More »

Abstract Class In Apex

An abstract class is a class that contains at least one abstract method, which is a method without a body (implementation). An abstract class cannot be instantiated on its own, but it can be inherited by other classes. When a class extends an abstract class, it must provide an implementation for all the abstract methods that are defined in the abstract class, otherwise, it should also be declared as an abstract class. There are a few other important points to consider when working with abstract classes:

Abstract Class In Apex Read More »

Interface In Apex

An interface in object-oriented programming is a way to define a set of methods that a class should implement. It is like a blueprint that specifies what a class should be able to do, but does not provide any implementation details for those methods.

When you define an interface, you only provide method signatures or declarations, which specify the name of the method, the parameters it takes, and the return type. However, you do not provide any code for the method bodies. This means that an interface only contains empty method bodies, or “placeholders” for the actual code that will be provided by a class that implements the interface.

Interface In Apex Read More »