Intro of JAVA
Learn Java
Types of Comments in Java:
Single-line comments are start with two forward slashes i.e.//. Whatever written inside // are ignored by compiler.It's only for user understanding.
Class Test{
Public Static Void main(String[]args)
{
//this is single line comment
System.out.println("hello youtube ");
}
}
Output:
Multi-line comments are start with /* and ends with */.Whatever written inside these are ignored by compiler.
Class Test{
Public Static Void main(String[]args)
{
/*this is multi line comment*/System.out.println("hello youtube ");
}
}
Output: