- Used to explain a code and make it more readable
- Used to prevent execution while testing alternate code
- Start with two forward slashes
//
- Technically for short comments
public class test(){
public static void main(String[] args){
System.out.println(5 + 6); // The output will be 11
}
}
- Starts with
/*
and ends with */
- Any text between these will be ignored
- Technically for long comments
public class text(){
public static void main(String[] args){
/* This is a long comment which will mostly likely go to the next line fo don' be mad if it does cause seriously its a long comment..haha */
System.out.println("LONG COMMMENT..LET'S GOOO");
}
}