.:Welcome to our Java tutorials:.

Visit our Web design support Forum

by April Griffin

Nov 4, 2002

Lesson 4 part 1

  • Comments

 

In this part you will learn about Data Types and Operators. Don't let that  scare you we are going to break this down and discuss it in real easy to understand English our first section is.... 

Comments Like HTML you can include comments in your code. this is very useful and there will be many occasions when you will want to do so to speak to the person viewing your code. The Complier doesn't see these comments they are only for people. you can use this to do a single line comment "//" here is an example

// this is a single line comment  

you will recognise // from your Lamers suck application and applet that you already created. Lets revisit the lamers suck code. 

/**
 * The LamersSuckApp class implements an application that
 * displays "Lamers Suck!" to the standard output.
 */
public class LamersSuck {
    public static void main(String[] args) {
        // Display "Lamers Suck!"
        System.out.println("Lamers Suck!");
    }
}

See its easy and you have already made your first single line comment. 

Another way to comment is the multiline comment. Think about how you open and close tags in HTML (once again if you have not taken the html tutorials I stress you should because it will train you to start thinking in code). Like HTML the multiline has an opener and a closer. type this to open a multiline comment  /* and type this to close it */ its not at all complicated its a concept like opening and closing in HTML. 

If you want to include your comment as part of the Java documentation you will make your comment by opening like this /** and closing with */

Lets revisit our lamer application code again eh

/**
 * The LamersSuckApp class implements an application that
 * displays "Lamers Suck!" to the standard output.
 
*/
public class LamersSuck {
    public static void main(String[] args) {

       
// Display "Lamers Suck!"
       
System.out.println("Lamers Suck!");
    }
}

As you can see you have already made use of this kind of comment. Now that you know what comments are and how to use them it is time to move on to part 2.

 

 




   


EmpireSponsor .:is offering Awesome fully loaded Hosting starting at 5$ 500-2056 Megs PHP! CGI! ASP! SSL Secure Server SQL!
 

 

.:Tutorials:.

HTML
CSS
Javascript
Java
Flash
PSP
Support Forum
 

.:Tools:.

Free Search Engine Submission
Meta tag generator
 

.:Tests:.

CSS validator
HTML validator
Website Garage
HTML Doctor
 
.: Search :.
Need To Find Something Fast?
© 2002-2003 Empireezine.tripod.com