Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

java commenting out of code

Thread view: 
patrick - 11 Jan 2006 10:28 GMT
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
Alan Krueger - 11 Jan 2006 13:34 GMT
> /**
> * bla bla bla
[quoted text clipped - 7 lines]
> 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.
patrick - 11 Jan 2006 14:03 GMT
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

>> /**
>> * bla bla bla
[quoted text clipped - 11 lines]
> If you use // for in-method comments, just comment the method not the
> preceding comment.
Remon van Vliet - 11 Jan 2006 14:09 GMT
Use a good editor, most IDEs have block commenting (i.e. add/remove // in
front of all selected lines with Ctrl+/ )

Remon

> Hmm,
>
[quoted text clipped - 18 lines]
>> If you use // for in-method comments, just comment the method not the
>> preceding comment.
Malte Christensen - 11 Jan 2006 15:05 GMT
> I want to comment out this code in java. How should  I do it.? Using
> JBuilder.
[quoted text clipped - 15 lines]
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.