java commenting out of code

P

patrick

I want to comment out this code in java. How should I do it.? Using
JBuilder.

/**
* bla bla bla
*/
void method A()
{
....
}

All the astisisks have to be got rid of first, then enclose with /* and */
I find this tedious.especially with big blocks of code.Is there an easier
way ?

As a result I normally use // to document my methods.

TIA
patrick
 
A

Alan Krueger

patrick said:
/**
* bla bla bla
*/
void method A()
{
...
}

All the astisisks have to be got rid of first, then enclose with /* and */
I find this tedious.especially with big blocks of code.Is there an easier
way ?

If you use // for in-method comments, just comment the method not the
preceding comment.
 
P

patrick

Hmm,

Still a problem if you want to comment out several methods.
Also I often find that Ive copied in long methods, from the web say, which
often use *'s a lot inside the method defimitions.
patrick
 
R

Remon van Vliet

Use a good editor, most IDEs have block commenting (i.e. add/remove // in
front of all selected lines with Ctrl+/ )

Remon
 
M

Malte Christensen

patrick said:
I want to comment out this code in java. How should I do it.? Using
JBuilder.

/**
* bla bla bla
*/
void method A()
{
...
}

All the astisisks have to be got rid of first, then enclose with /* and */
I find this tedious.especially with big blocks of code.Is there an easier
way ?

As a result I normally use // to document my methods.

TIA
patrick

In JDeveloper you just mark the block, then hit alt+u the t. The effect
is to prepend // to each line in the block.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,573
Members
45,046
Latest member
Gavizuho

Latest Threads

Top