Android studio generates Javadoc automatically

Time:2019-12-2

If you want to annotate your methods, Android Studio provides a simple way to implement it.

First define your method, whether it’s a parameter value or a return value, then hover over the method and type/**andEnter, you will see the Javadoc comment added to your method name.

  1. Define your approach

    private boolean shouldGenerateAutoComments(String title, boolean isValid, List<String> listNames){

           // function code
           return true;

    }

  2. Hover over the method and type/**, and then clickEnter

/**
  *@param title
  *@param isValid
  *@param listNames
  *@return
  */  
private boolean shouldGenerateAutoComments(String title, boolean isValid, List<String> listNames){
    // function code
    return true;
}