Java comments are either explanations of the source code or descriptions of classes, interfaces, methods, and fields. There are three types of comments used in Java. These are:
1. Single Line Comments:
To add a comment in one line using two slash characters i.e.
//text.Starting with the
// text ignore by compiler.
//This is single line comment.
2. Multi Line Comments:
To add a comment in multi line start using slash and asterisk characters and end using asterisk and slash i.e.
/*This is multi line comment. Welcome to Tech2Our. */
3. Documentation Comment.
The JDK javadoc tool uses doc comments when preparing automatically generated documentation.
/**Get the Student name and roll number. *@ return this Student' name *@ Mobile Number should be ten digit */
Java is an object-oriented programming language. It was released by “SUN MicroSystems” in June 1995. Java is popular for it’s “Write Once, plateformRun Everywhere” feature. This feature enables a Java programmer written on a platform to execute any platform.