visualize here!

Basic Rules

  1. Java is an OOP program language.All code in Java must be part of a class.
  2. We delimit the beginning and end of segments of code using { and }.
  3. All statements in Java must end in a semi-colon.
  4. For code to run we need public static void main(String[] args)
  5. Before Java variables can be used, they must be declared.
  6. Java variables must have a specific type.
  7. Java variable types can never change.
  8. Java needs compiling so types are verified before the code even runs!
  9. Functions must be declared as part of a class in Java.
    A function that is part of a class is called a “method”.
    So in Java, all functions are methods.
  10. All parameters of a function must have a declared type,
    and the return value of the function must have a declared type, if do not return anything, use void.
    Functions in Java return only one value!

Advantage

Other

  • Arrays in java have most 2 billion entries.