Activity Forums Salesforce® Discussions What is utility class in Salesforce?

  • chanchal kumar

    Member
    July 18, 2018 at 3:24 pm

    hello madhulika,

    those methods which are used frequently in code, we make a utility class of them and we can reuse this method whenever we required it.

  • shariq

    Member
    September 18, 2018 at 1:43 am

    Hi,

    This class contain reusable codes, so that we need not to rewrite it again and again, we just call the method from that class into other as depending our logic.

    Hope this helps.

  • Parul

    Member
    September 18, 2018 at 2:42 am

    Hi

    The purpose of a utility class is to serve as a single one-stop-shop for reusable pieces of code. Basically any variable, method, inner class and whatever it might be that is used multiple times across multiple other classes within the project, can reside into a single (or multiple) utility class(es), which helps writing more elegant and structured code, as well as makes the code easier to maintain.

     

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos