Object-Oriented Programming in Apex
Classes & Methods
What Is a Class in Apex?
A class is a blueprint that defines behavior (methods) and data (variables).
Simple Explanation
A class is like a recipe, and methods are the steps.
Code Example
public class Car {
public void drive() {
System.debug('Car is moving');
}
}
What Is a Method?
A method is a function inside a class that performs an action.
