General Java

==Java Core==
First Object Oriented Programming language was: simula
creator of Java is James Gosling
abstraction hides complexity is the devise of abstraction, important in OOP, because you can't depict everything that exists in real life
difference "&&" to "&": SIngle & continuous evaluating all conditions, even if a prior one if false, "&&" continuous until all conditions have been checked
Method to start must be (following order and capitalization): public static void main(String[] args)
Assignment: Assigns value to variable
Assignment: Ternary operator <Condition> ? <Value case condition true> : <Value case condition false>;
Unary Operator: +, -, ++, --, !
Compile: Compile a *.java File using the command: javac <File>.java
Assosciativity: Assignment and Conditional (?:), and Unitary have right to left assignment, the rest left to right
Capitalization: 
* Java keywords in lowercase
* Constants in all uppercase
* Class name starts with Capital name
* Variable anything
Java Stack
static vs. instance methods and variables
static methods or variables belong to a class as a whole, and can be used without being instantiated, or with a null reference
the opposite is "instance variable"
Collection Vs. Collections
Collection is an interface used to represent a group of objects as an individual unit
Collections i a utility class that defines several utility methods that are used to operate on collection.
Java Utility Class
A utility class in Java is a class that provides static methods that are accessible for use across an application. The static methods in utility classes are used for performing common routines in our application.
Utility classes cannot be instantiated and are sometimes stateless without static variables. We declare a utility class as final, and all its methods must be static.
Since we don’t want our utility classes to be instantiated, a private constructor is introduced. Having a private constructor means that Java won’t create a default constructor for our utility class. The constructor can be empty.
Methods of a utility are accessed via the class name. It makes our code more flexible for use while remaining modular.
Java has utility classes such as java.util.Arrays, java.lang.Math, java.util.Scanner, java.util.Collections, etc.
JRE JDK JVM
JDK: Java Development Kit is the core component of Java Environment and provides all the tools, executables, and binaries required to compile, debug, and execute a Java Program. 
* JDK is platform-specific
* contains JRE
* additionally contains Java compiler, debugger, and core classes.
JVM: When we execute a Java program, JVM is responsible for converting the byte code to the machine-specific code. 
* platform-dependent and 
* provides core java functions such as memory management, garbage collection, security, etc. JVM is 
* customizable and we can use java options to customize it. For example, allocating minimum and maximum memory to JVM. 
* virtual, provides an interface that does not depend on the underlying operating system and machine hardware. -> write-once-run-anywhere.
JRE: JRE is the implementation of JVM that provides a platform to execute java programs. JRE consists of JVM, Java binaries, and other classes to execute any program successfully. If you just want to execute a java program, you can install only JRE.
JDK vs JRE vs JVM
The difference is between development, execution, and compilation
# JDK is for development purpose whereas JRE is for running the java programs.
# JDK and JRE both contains JVM so that we can run our java program.
# JVM is the heart of java programming language and provides platform independence.
===Byte vs Bit===
A bit is the smallest unit of digital data. It represents a binary digit with a value of either 0 or 1. Multiple bits represent more complex data such as characters, numbers, images, and videos. For example, the letter "A" can be represented by the 8-bit binary code 01000001.
A byte, on the other hand, is a group of 8 bits. It is the basic unit of storage in most computer systems. Bytes represent larger data types, such as words, images, and files. For example, a single page of text in a document may require several kilobytes (thousands of bytes) of storage.
===Stack===
The stack is a linear data structure that is used to store the collection of objects. It is based on Last-In-First-Out (LIFO)
===Runtime Vs. Compilation Error===
A compile-time error generally refers to the errors that correspond to the semantics or syntax. A runtime error refers to the error that we encounter during the code execution during runtime.
===Primitive Datatypes===
Primitive datatypes specify the size and type of variable values, and have no additional methods.
There are eight pNo wiki formattingrimitive data types in Java:
 Caption
Header cell 	Header cell
Byte, Short, Int, Long	(1 byte, 2 bytes, 4bytes, 8 bytes)
Boolean 	(1 bit)
Float, double 	(4 bytes, 8 bytes)
Char 	(2 bytes)
===Default Variables===
Local bariable don’t have a default variable
Global variables have a default variable, which is 0 (and its brothers and sisters) for numerative datatypes, false for Boolean, and “\u0000” for char. 
It is null for “String” and any other non-primitive datatypes
===Systems Java runs on===
Java runs on Windows, Unix/Linux, Mac, and probably more
===Java.lang===
Contains new classes that define other classes, e.g. Object, Enum, Wrapper-classes for the primitive datatypes, etc.
===Marker===
To define an Marker to be used as Annotation, you write "@interface <nameOfMarker>{}". If it is suppossed to contain attributes, you can define them here. It can be added to classes and functions, but must be designed before and/or outside of the class
==Security in java==
===Explicit (done by programmer)===
Secure Sockets Layer, a standard security technology for establishing an encrypted link between a server and a client
Transport Layer Security, the successor of the above standard
Cryptography, you have a key that you use to encrypt information, and needing the same key to decrypt is, all done in the name of data security
Java Authentication and Authorization Service (JAAS) is a Java API that makes it possible to provide services for authentication and access rights in Java programs. JAAS is based on the Pluggable Authentication Modules (PAM) and thus supports user-based authorization.
A pluggable authentication module (PAM) is a mechanism to integrate multiple low-level authentication schemes into a high-level application programming interface (API). PAM allows programs that rely on authentication to be written independently of the underlying authentication scheme.
===Implicit (done by system)===
The bytecode verifier acts as a sort of gatekeeper: it ensures that code passed to the Java interpreter is in a fit state to be executed and can run without fear of breaking the Java interpreter. Imported code is not allowed to execute by any means until after it has passed the verifier's tests.
==Enum==
Example: 
==Manifest==
*Defines the version of main-class (in case anything changes, duh) 
*Defines the actual main class to be executed in case it's ambiguous (give path and file-name)
*It is created automatically whenever a JAr file is created
to create custom manifest, create a *.txt file, and run cfm instead of m and include the file
jar cf MyJar.jar classes/ //create without custom manifest
jar cfm MyJar.jar manifest.txt classes/ //create with manifest file
==Interface==
you can implement a function in the Interface (rather than only its signatures) by giving it the keywoard default
==Labeled Loop==
class HelloWorld {
 
 private static char c;
 
 public static void main(String args[]) throws Exception {
 
 outer:
 for(int x = 1900;x<=2028;x++){
 
 inner:
 for(int y = 1;y<=12;y++){
 System.out.println(y+" - "+x);
 if(y == 2 && x%4==0){
 System.out.println(x+"Leap Year");
 continue outer;
 }
 }
 System.out.println(x+"No Leap Year");
 }
 }
}
===Enhanced For Loop===
It is the following for loop that you have used a million times:
for(data_type variable : array | collection){