2.JavaFeatures, JVM
2.JavaFeatures, JVM
Module-1
Introduction to Java
Features of Java
Components of Java
• JDK
• JRE
• JVM
Data Types
Variable
Dr.M.Sivakumar, Saveetha University 3
JAVA
Java is a general-purpose computer-programming language that is open source, platform
independent, object-oriented and specifically designed to have as few implementation
dependencies as possible.
Java was originally developed by James Gosling at Sun Microsystems and released in 1995.
Java was initially named as Oak language and renamed to JAVA in 1995.
Current Version Java SE 15 (as of feb-2021)
Version we will use Java SE 11 (LTS)
Setup size 149 MB (Linux), 152 MB (Windows x64)
Download Link https://www.oracle.com/in/java/technologies/javase-jdk11-downloads.html
Official Website https://java.com
Integrated Development 1. Eclipse (going to use this IDE in later chapters)
Environment 2. NetBeans
(IDE) 3. IntelliJ IDEA Community Edition
4. BlueJ
Object Oriented: “Everything is an object” paradigm, which possess some state, behavior
and all the operations are performed using these objects.
Robust: Java has a strong memory management system. It helps in eliminating error as it
checks the code during compile and runtime.
High Performance: Java achieves high performance through the use of bytecode which
can be easily translated into native machine code. With the use of JIT (Just-In-Time)
compilers, Java enables high performance.
Distributed: Java provides a feature which helps to create distributed applications. Using
Remote Method Invocation (RMI), a program can invoke a method of another program
across a network and get the output. You can access files by calling the methods from
any machine on the internet.
Dynamic: Java has ability to adapt to an evolving environment which supports dynamic
memory allocation due to which memory wastage is reduced and performance of the
application is increased.
Launcher
(java.exe), Runtime
AppletViewer, Libraries
etc..)
Compiler
2
3
4
We have to save this in HelloWorld.java file as it has public class named HelloWorld.
String and System are inbuilt Java Classes.
Classes in java are always written in Camel case.
Java Datatypes
Primitive Non-primitive
Floating-point
Integers Characters Boolean Class
numbers
A variable that is declared and used inside the body of methods, constructors, or blocks
A variable that is declared inside the class but outside the body of methods,
constructors, or blocks
Static variables are always declared inside the class but outside of any methods,
constructors, or blocks.
It will have common memory, where all the objects shares the same.
class AA {
int aa; // instance variable
static int bb; // static variable
public static void main(String[] args) {
int a = 5; // local variable
}