Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I have an apex function which has a void return type. I want to exit the function at a specific position. Is this possible in apex without changing return type pagereference?

1 Answer

0 votes
by (32.1k points)

In Apex, the return keyword is used to immediately stop processing statements in the respective statement.

public void doNothing() {

     return;

}

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...