JavaRush /Java Blog /Random EN /Comments in java

Comments in java

Published in the Random EN group
Hi all! This short article will be useful for beginners who have just encountered comments in java.
Comments in java - 1
Comments are used to highlight text or parts of code in the code so that the compiler does not see them. Example with line selection:
System.out.println("Java");
//вот этот текст компилятор не видит
The result will be:
Java
Example with selecting several lines:
/*
 Пример простой программы на Java
*/
public class Class
{
 public static void main (String [] args)
 {
 System.out.println("Java");
 }
In this case the result will be the same. Let's conclude: // - a line is commented out /* */ - several lines are commented out Thank you for your attention!
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION