Comments in java. Types of comments used in java
Java Commen ts : The Java comments are the statements that are not executed by the compiler and interpreter. The comments can be used to provide information or explanation about the variable, method, class or any statement. Java Comments are used in programs to make the code more understandable. Comments in Java are often are non-executable statements, used to understand the code better and to make it more readable. Types of Java Commen ts There are three types of comments in Java. 1. Single Line Comment 2. Multi Line Comment 3. Documentation Comment 1. Single Line Commen t : The single line comment is used to comment only one line.It is the easiest typed comments. Syntax: //This is comment Example: public class comment { public static void main(String[] args) { //This is main method int x=10; System.out.println("X="+x); } } Output : X=10 2. Multi Line Commen t : The multi line comment is used to commen...