Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder ttttt's Avatar
    Join Date
    Oct 2005
    Posts
    372
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Quick Question About Java Comments

    You know on code for web pages and script, you often see something like this
    Code:
    */My comment about the script/*
    Well.....Is it possible to do this with Java?
    Thanks
    ttttt
    http://openoffice.org/- Microsoft Office without the Microsoft.
    [home page][forum]
    Versatile, free software

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    // one line comment


    /*

    block comment

    */
    I am the luckiest man in the world

  • #3
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    Various programming languages use different ways of commenting, so just be careful what language you're in.

    Java (and JavaScript follows the same method, which is why you've seen it in scripts) and C++:

    Code:
    // Only this line is a comment
     
    /*
      Whatever's between the two is a comment
    */
    HTML:

    Code:
    <!-- This is a comment -->
    CSS:

    Code:
    /* This is a comment */
    VBScript:

    Code:
    ' This is a comment
    ColdFusion:

    Code:
    <!--- This is a comment --->
    Perl:
    Code:
    # This is a comment
    C:
    Code:
    // This is a comment
    ... and the list goes on.

    -Shane
    Last edited by TheShaner; 10-25-2005 at 03:27 PM.

  • #4
    Regular Coder ttttt's Avatar
    Join Date
    Oct 2005
    Posts
    372
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks that told me everything I need to know.
    Thanks Again
    ttttt
    http://openoffice.org/- Microsoft Office without the Microsoft.
    [home page][forum]
    Versatile, free software


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •