Writing tool classes

Constructor, decorated with private. cannot be instantiated

The member method is modified with static and can be called directly by the class name dotted

public class  Utils{

    //Construction method

     private Utils(){

     }

  // member method

     public static int MM(){

          return 10;

    }

  

}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326357751&siteId=291194637