Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java commenting out of code

Reply
Thread Tools

java commenting out of code

 
 
patrick
Guest
Posts: n/a
 
      01-11-2006
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


 
Reply With Quote
 
 
 
 
Alan Krueger
Guest
Posts: n/a
 
      01-11-2006
patrick wrote:
> /**
> * 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.
 
Reply With Quote
 
 
 
 
patrick
Guest
Posts: n/a
 
      01-11-2006
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

"Alan Krueger" <(E-Mail Removed)> wrote in message
news:RP7xf.2201$(E-Mail Removed)...
> patrick wrote:
>> /**
>> * 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.



 
Reply With Quote
 
Remon van Vliet
Guest
Posts: n/a
 
      01-11-2006
Use a good editor, most IDEs have block commenting (i.e. add/remove // in
front of all selected lines with Ctrl+/ )

Remon

"patrick" <(E-Mail Removed)> wrote in message
news:1f8xf.4381$(E-Mail Removed)...
> 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
>
> "Alan Krueger" <(E-Mail Removed)> wrote in message
> news:RP7xf.2201$(E-Mail Removed)...
>> patrick wrote:
>>> /**
>>> * 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.

>
>



 
Reply With Quote
 
Malte Christensen
Guest
Posts: n/a
 
      01-11-2006
patrick wrote:
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: commenting out blocks of code Peter Hansen Python 8 02-20-2006 12:42 AM
Re: commenting out blocks of code Jean-Paul Calderone Python 0 02-18-2006 02:09 AM
Re: commenting out blocks of code Paul McNett Python 1 02-18-2006 02:08 AM
Commenting out VB code =?Utf-8?B?U2FuZHk=?= ASP .Net 5 02-03-2005 05:51 PM
Commenting out debug code Michael C++ 3 05-27-2004 11:55 AM



Advertisments