The comments are the statements that are not executed by the compiler and interpreter. It can be used to provide information or explanation about the variable, method, class or any statement. It can also be used to hide program code for a specific time.
1. Single Line comments are started by // and may be positioned after a statement on the same line, but not before.
Example:
//single line comment
2. Multi-Line comments are defined between /* and */. They can span multiple lines and may even been positioned between statements.
Example:
/*
Multi
Line
Comment
*/
This is a Java program that demonstrates single and multi-line comments.
Overall, this program demonstrates the use of single-line comments with // and multi-line comments with /* ... */ in Java. When executed, the program will only print "Welcome To Tutor Joes" to the console, as the multi-line comment is not executed by the compiler.
//03 Single and Multi Line Comment in Java import java.lang.*; class comments { public static void main(String args[]) { System.out.println("Welcome To Tutor Joes"); /* In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. */ } }
Welcome To Tutor JoesTo download raw file Click Here
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions