JAVA
JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language. Writing, compiling and debugging a program is easy in java.
Java Terminology
ByteCode
The java compiler compiles the source code to bytecode.
Java Virtual Machine (JVM)
This java virtual machine allows to run the same code on different operating systems
Java Development Kit (JDK)
is a development toolkit that allows you to create, compile and run java programs.
Programming Paradigm
Java is a language designed to use the object-oriented programming paradigm.
Object oriented programming is a way of organizing programs as collection of objects, each of which represents an instance of a class.
4 main concepts of Object Oriented programming are:
Abstraction
Abstraction is a process where you show only “relevant” data and “hide” unnecessary details of an object from the user.
Encapsulation
Encapsulation is:
- Binding the data with the code that manipulates it.
- It keeps the data and the code safe from external interference.
Can be easily used regardless of implementation details.
There shouldn’t any side effects of the code, to the rest of the application.
The idea of encapsulation is to keep classes separated and prevent them from having tightly coupled with each other.
Everyone knows how to access it.
Polymorphism
Polymorphism means to process objects differently based on their data type.
In other words it means, one method with multiple implementation, for a certain class of action. And which implementation to be used is decided at runtime depending upon the situation (i.e., data type of the object)
This can be implemented by designing a generic interface, which provides generic methods for a certain class of action and there can be multiple classes, which provides the implementation of these generic methods.
Inheritance
La herencia es el mecanismo por el cual un objeto adquiere las propiedades algunas / todas de otro objeto.
Apoya el concepto de clasificación jerárquica.
Simple and Robust
It is an easy to read and write language, the way it was developed allows:
Early error detection
Garbage collection
Exception handling
Memory allocation
Secure
The java buffer cannot be accessed so it is impossible to corrupt it.
Java is distributed and Multithreading
Java allows the creation of distributed applications between systems connected to each other through internet connection
Also allows the use of multiple threads to get the most out of the cpu.