Comments - Inline
Comments - Inline
In Apex, inline comments are used to add explanatory notes to a single line of code. They are created using two forward slashes //
. Anything following //
on the same line is ignored by the compiler.
Example
// This is an inline comment String welcomeMessage = 'Hello, World!'; // This comment explains the variable