how to add multiline comment with /* */ using shortcut keys in netbeans IDE 8.3

◇◆丶佛笑我妖孽 提交于 2020-01-05 07:44:07

问题


Looking for the shortcut key to add multiline(/* */) comments.

shortcut : "Ctr+/" used to add the comment but its comes with "//" like this ..

//line1
//line2
//line3 

I want the comments like below one , using shortcuts key..

/*     line 1
       line 2
       line 3
    */

回答1:


I am using Netbeans 8.2. For multiline comments


just type /* OR /** and then press Enter.


Hopefully, this will work.


When you use /** to add a comment for an existing method it will generate a skeleton Javadoc for that method.

but as I know Netbeans 8.3 is not released and never will be. Version 9 will be released instead. You might use version 8.2 or lower.




回答2:


There is no shortcut for a multi-line comment in NetBeans, presumably because there is no need for one; if you simply type /* and press Enter then NetBeans will automatically insert a blank line, followed by */ on the next line, and then position the cursor on the blank line:

/* {cursor is set here} */

(Somewhat related, and slightly more impressive, you can also type /** and press Enter on the line before a method and NetBeans will generate a skeleton Javadoc for that method.)



来源:https://stackoverflow.com/questions/47726614/how-to-add-multiline-comment-with-using-shortcut-keys-in-netbeans-ide-8-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!