Avinash Raut
Avinash Raut

Reputation: 2113

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

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
    */

Upvotes: 2

Views: 3056

Answers (2)

Pramod Dissanayake
Pramod Dissanayake

Reputation: 141

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.

default comment structure

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.

Upvotes: 4

skomisa
skomisa

Reputation: 17363

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.)

Upvotes: 1

Related Questions