Friday, July 12, 2024

Comments In Java

 

Comments:

   can be used to understand the program clearly

Types of Comments:

There are 2 types of comments in Java:

  1. Single-line comment:
  2. Multi-line comment:

1.     Single-line comment:

  • Starts with //

 

package Package1;

 

public class MyClass1

{

//  Program name :  Writing comments

                //   Developed Date:  6-Apr-2023             

               // Comments will not be executed  and it will be ignored

              

//            Note:  Single line comments : 

//            select line +   Press Ctrl + / == to comment lines

//            uncomment line = Press Ctrl + /

              

//            stmt1

//            stm2     

//            stmt3

              

//            note2  :

//select multiple lines  and Press ctrl +  / -- it comments selected  lines

//            select multiple lines and Press ctrl +  / -- it uncomments selected  lines

              

//            stmt1

//            stm2     

//            stmt3

 

}

 

2. Multi line comments:              

//            Multi Lines : starts with /*      */

              

package Package1;

public class MyClass2

{

 

 

               //            Multi Lines : starts with /*      */

 

               /*   Author : Brahma 

                    Program name :  Writing comments

                   Devleoped Date:  6-Apr-2023  */

 

               /*  stmt-1

                  stm-2

                  stm-3

                */

 

 

               //            Note : select multiple lines - Press  ctrl+ shft + /

               //                            uncomment  -          ctrl+ shft + \

 

 

               /*

                * Author : Brahma Program name : Writing comments Devleoped Date: 6-Apr-2023

                *

                * stnt-1 stm2 stm-2

                */

 

 

               /*  stmt-1

                  stm-2

                  stm-3

                */

 

}

No comments:

Post a Comment

git commands MCQ

 Here are some multiple-choice questions (MCQs) on Git commands relevant for Selenium: 1. Which Git command is used to clone a remote reposi...