Skip to content

Basics - I

  • Single-line comments - //
  • Multi-line comments - /* ... */
  • Documentation String - /** .... */

abstract, continue, for, new, switch assert, default, goto, package, synchronized boolean, do, if, private, this break, double, implements, protected, throw byte, else, import, public, throws case, enum, instanceof, return, transient catch, extends, int, short, try char, final, interface, static, void class, finally, long, strictfp, volatile const, float, native, super, while

  • Arithmetic Operators: Perform basic math operations (e.g., +, -, *, /) on numeric operands.
  • Relational Operators: Compare values and return boolean results (e.g., >, <, ==, !=).
  • Logical Operators: Combine boolean expressions (e.g., &&, ||, !) to produce boolean results.
  • Bitwise Operators: Perform operations at the binary level (e.g., &, |, ^) on integer operands.
  • Assignment Operators: Assign values to variables (e.g., =, +=, -=) and perform compound assignments.
  • Conditional (Ternary) Operator: A short-hand if-else operator (e.g., condition ? true-value : false-value) for conditional assignments.
  • if
  • if-else
  • if-else-ladder
  • ternary
  • switch
  • for
    • labelled loops i.e break label1; or continue label2;
    • for(int i = 0; i < 10; i++) {
      ...
      }
  • for-each
    • for(var ele: elementList) {
      ...
      }
  • while
    • int whileCounter = 1;
      while (whileCounter <= 50) {
      ...
      whileCounter++;
      }
  • do-while
  • break
  • continue