Basic Introduction of Java – QuantaInfotech.com
Introduction of JAVA
- Java is a popular and powerful language. Although it is a very simple language.
- It is an object-oriented programming language (OOP) with a built-in API(Application Programming Interface) that can handle GUI.
- Much of the syntax of Java is similar to C and C++, major difference is java doesn’t have pointers.
- Using Java we can create Android Application, Web Applications, Windows Applications
History of Java
- Java was developed by James Gosling, who is known as the father of Java, in 1995 at Sun Microsystems (which is now a subsidiary of Oracle Corporation).
- Initially designed for small, embedded systems in electronic appliances like set-top boxes
- Currently, Java is used in internet programming, mobile devices, games, e-business solutions, etc.
- Firstly, it was called “Greentalk” by James Gosling, and the file extension was .gt.
- After that, it was called Oak and was developed as a part of the Green project.
- Why Oak? Oak is a symbol of strength and chosen as a national tree of many countries like the U.S.A., France, Germany, Romania, etc
- In 1995, Oak was renamed as “Java” because it was already a trademark by Oak Technologies.
- Java is an island of Indonesia where the first coffee was produced (called java coffee). Java name was chosen by James Gosling while having coffee near his office.
- High level Language – It is high level language similar to C and C++ but has many unique features.
- Java Bytecode – Bytecode in java is an intermediate code generated by the compiler such as javac, executed by JVM.
- JAVA Virtual Machine (JVM) – JVM acts asan interpreter for the Bytecode, which takes bytecodes as input and execute.Java source code
Java Virtual Machine (JVM)
- A Java virtual machine is a virtual machine that enables a computer to run Java programs.
- Java Bytecode execute on a virtual machine
- Most programming languages compile the source code directly into machine code, the difference with java is that is uses bytecode, an intermediate code.
- JVM is responsible for allocating the necessary memory needed by the Java program.
- The JVM performs following operation:
- Loads code
- Verifies code
- Executes code
- Provides runtime environment
Features of Java
- Platform Independent
- Object Oriented
- Both compiler and interpreter
- Java is Robust
- Security Features
- Java is multithread
- Automatic Memory Management
Difference between Java and C++
- Multiple Inheritance Not Allowed –
- Common Parent – All classes are single rooted. The class object is parent of all classes in java.
- All Codes inside Class – Also Global declaration outside of Class not allowed.
- go to – instead of go to, break and continue supported
- Pointers – No pointers in java
- Automatic Variable Initialisation – All variable automatically initialized, except local variable.
Chapter 1 – Basic Introduction of Java