How to generate javadoc comments in Android Studio

前端 未结 16 2294
野的像风
野的像风 2020-12-04 10:01

Can I use shortcut keys in Android studio to generate javadoc comments?

If not, what is the easiest way to generate javadoc comments?

16条回答
  •  無奈伤痛
    2020-12-04 10:25

    Here is an example of a JavaDoc comment from Oracle:

    /**
     * Returns an Image object that can then be painted on the screen. 
     * The url argument must specify an absolute {@link URL}. The name
     * argument is a specifier that is relative to the url argument. 
     * 

    * This method always returns immediately, whether or not the * image exists. When this applet attempts to draw the image on * the screen, the data will be loaded. The graphics primitives * that draw the image will incrementally paint on the screen. * * @param url an absolute URL giving the base location of the image * @param name the location of the image, relative to the url argument * @return the image at the specified URL * @see Image */ public Image getImage(URL url, String name) { try { return getImage(new URL(url, name)); } catch (MalformedURLException e) { return null; } }

    The basic format can be auto generated in either of the following ways:

    • Position the cursor above the method and type /** + Enter
    • Position the cursor on the method name and press Alt + Enter > click Add JavaDoc

提交回复
热议问题