The comments are used for explaining the code. The comments make the understandability of a program faster. The comments improve the readability of the code.
The java language provides 3 types of comments:
- Single Line Comments
- Multi Line Comments
- Documentation Comments
1) Single Line Comments
Using the single line comments we can write a message in a single line. The single line comments begin with // symbols and they end in the same line.
Example: // This is single line comment
2) Multi Line Comments
Using the multi comments we can write the message in multiple lines. Multi line comments begin with /* and ending with */. In between these symbols we can specify any number of lines.
Example: /* This is line one comment
This is line two comment
This is line three comment*/
3) Documentation Comments
Using the documentation comments we can create the manual for the project that is developed. Using these comments we can create the API (Application Programming Interface). The documentation comments begins with /** and ending with */.
Example /** author: AndroIndian
created on: 18/01/2022
last modified on : 18/01/2023
…………………. */
To develop the java program we need to install java software. The java software is a freeware, which can be downloaded from internet. Once the java software is installed, we need to set the path. The PATH is called an environment variable. The variable of an operating system are called as environment variables.
Setting the PATH is a process of specifying the address or location of the java commands to the OS (Operating System)
Syntax
set PATH= java installation folder
set PATH:=c:/Program Files/Java/jdk1.6.0_21/bin
Program2:
class SecondProgram{
public static void main(String[] args){
System.out.println("This is my second");
System.out.println("Java Program");
System.out.println("at AndroIndian");
}
}