Mark As Completed Discussion

One Pager Cheat Sheet

  • Java is a highly efficient, object-oriented programming language developed by James Gosling at Sun Microsystems that is designed for reliability, reusability, and security.
  • Java offers 8 primitive data types: byte, short, int, long, float, double, boolean, and char that are used to store values of various sizes and types.
  • Referential types like Strings, Classes, and Objects, which are created by the programmer, have a default value of null and refer to objects.
  • Variables in Java are references to memory which are declared in different scopes (Local, Instance, Static) and cannot be accessed beyond their scope.
  • Instance variables are declared inside classes and have different values for each instantiated object, while static variables are shared among all instances of a class.
  • In Java, user input can be taken in three ways: Using Scanner, Console class, and BufferedReader class.
  • A Java program consists of Classes, Objects, Variables and Methods.
  • In order to compile a Java program, you must save it as a .java file and then call the compiler with the javac command before running it with the java command.
  • Iterative statements, such as for and while loops, allow us to repeat statements until a certain condition is met, such as in the classic Fizz Buzz problem.
  • Decisive Statements in Java, such as if and else if statements, allow you to control the flow of execution depending on conditions known only during runtime.
  • Arrays in Java are the most primitive way of aggregating elements of the same datatypes and can be declared and initialized either with curly braces or the new keyword.
  • Strings in Java are immutable objects represented by the java.lang.String class, which implements the Serializable, Comparable, and CharSequence interfaces, and Java offers two mutable utility classes: StringBuilder and StringBuffer, with the latter being thread-safe.
  • Java is an Object-Oriented programming (OOP) language with classes, objects, constructors, and methods used to implement the four basic principles of OOP, namely polymorphism, abstraction, inheritance, and encapsulation.