问题
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