Sat. Nov 16th, 2024

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:

  1. Single Line Comments
  2. Multi Line Comments
  3. 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");
   }
}

By Rajashekar

I’m (Rajashekar) a core Android developer with complimenting skills as a web developer from India. I cherish taking up complex problems and turning them into beautiful interfaces. My love for decrypting the logic and structure of coding keeps me pushing towards writing elegant and proficient code, whether it is Android, PHP, Flutter or any other platforms. You would find me involved in cuisines, reading, travelling during my leisure hours.

Leave a Reply

Your email address will not be published. Required fields are marked *