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;

}

Related questions

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...