IntScription()
← Back to Notes Home
  • Used to explain a code and make it more readable
  • Used to prevent execution while testing alternate code

Single-line Comments

  • 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
  }
}

Multi-line Comments

  • 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");
  }
}