How to automatically generate comments for your function in Android Studio?

By | May 27, 2017

This is a simple trick in Android Studio.

First you have to write the skeleton of your function like this


private boolean demoFunction(String val){
    return true;
}

Now to generate the comments for this function just type “/**” on top of the function and hit “enter”. You will see the comments generated for you.

Now your function will look like this

/**
* @param val
* @return
*/
private boolean demoFunction(String val){
    return true;
}

Leave your comments if you like this tip.

Leave a Reply

Your email address will not be published. Required fields are marked *