In this tutorial, you will learn the basics of java with following things
- Introduction to Java
- Java Features
- Java Architecture
- Java Applications
- Java Family
- Java Tools and SDK Requirements.
JAVA
- Java is a general purpose, high level, object oriented programming language
- Java is an example of OOPS language
- Write Once Run Anywhere (WORA) language. This means that the compiled java code can be run on any platform such as windows, linux, mac, etc, …
- Change of the platform does not affect the original java program
- It is mainly designed for web / internet applications
- Pure object oriented language
- In java, it is not possible to write a code without using class and object
FEATURES
1. Simple
- Java is a simple and easy to learn, easy to understand
- Because
- Its syntax is based on c++
- It removed many complicated features for example: operator overloading, explicit pointers, etc, …
2. Platform Independent
- Java is a platform independent language that means, java is not dependent on any platform or OS
- It supports multiple platforms such as windows, linux, mac, etc, ..
3. Object Oriented
- Java is an object oriented programming language
- It supports the oops features such as class and objects, inheritance, polymorphism, encapsulation, etc, …
- Everything in java is an object (except java base data types: int, float, double, etc)
4. Interpreted and Compiled Language
- Unlike c/c++, java is a two-way language
- It supports both compilation and interpretation
5. Strongly Typed Language (Static Typed System)
- Java supports static typed systems. Data types must be mentioned in the variable / method creation
- Ex. int k=10;
6. High Performance
- Java program is compiled into java byte code (.class file) which is highly optimized by the java compiler, so that the java virtual machine (JVM) can execute java applications / programs at full speed. (Byte codes are highly optimized)
7. Multithreading support
- Java supports the multithreading concept. That means we can build applications with concurrent threads of activity.
8. Security
- Java gives best choice for security
- We can develop virus free systems with help of java secure features
9. Exception Handling
- Java handles runtime errors with help of exception handling concept
10. Architecture Neutral
- Java is an architecture neutral language. Because it does not depend on the architecture (organization of processor, memory, CPU, input/output) of a computer.
- Hence, java code can be run on any computer architecture.
11. Distributed
- Java is a distributed language. This means that java programs running on one machine can easily access the resources (files, java objects, etc, …) of other machines on the internet.
- It provides class libraries for high-level support of networking
- Remote method invocation(RMI) API’s allow java programs to call methods of remote java objects, as if they were local objects
- RMI and EJB are mostly used for distributed programming.
JAVA ARCHITECTURE
Operating System
- Java is a platform independent OS
- Ex. Windows, Linux, Mac, etc, …
JVM (JAVA VIRTUAL MACHINE)
- Runtime manager or Runtime engine for Java
- Used to convert the byte code(.class) or object file or class file or machine code to target output
Java System Packages
- It is a part of java API (Application Programming Interface)
- Package is a group of classes, interfaces and sub packages
- Package is classified as two types in java. They are
1. System packages / Built-in packages
- Standard packages which comes as a part of Java Runtime Environment (JRE)
2. User defined packages
- Package defined by the user / programmer to bundle group of related classes
NOTE
- The operator ‘*’ is used load all classes and interfaces in a specified package
1. java.lang.*
- It is used for basic operations, mathematical operations, string features (String, StringBuffer, StringBuilder) thread operations in java
2. java.io.*
- This package is used for input & output related operations, File and Directory related operations
3. java.util.*
- This package provides the support for ArrayList, Vector, advanced data structures such as list, set, map interfaces
4. java.sql.*
- It is used for database related operations
- Storage & retrieval
- CRUD operations
5. java.net.*
- This package contains the predefined classes for supporting network related operations like TCP and UDP based applications
6. java.awt.*
- This package contains the predefined classes for implementing Windows GUI application / Desktop based applications
7. java.applet.*
- This package is used for creating applet (GUI) based applications.
Java Applications
- Java supports 4+ different types of applications. They are:
- Console Application
- Windows GUI Application
- Web Application
- Database Application
- Smart Phone Application
1. Console Application
- Creating an application without using any graphical components, that is called a console application.
2. Windows / Desktop Application (offline)
- Creating an application, with use of graphical components that is called as windows GUI Application (windows forms application)
- It is an offline application: possible to run the windows GUI application in a particular machine at a time
- Technologies: Applets, AWT, Swing, JavaFX, etc, …
3. Web / Internet Application (online)
- Creating an application, with use of web graphical components that is called as Web GUI Application
- It is an online application: possible to run the web GUI application in all machine at a time via internet access
- Technologies: JSP, Servlet
4. Database Application
- Creating a database related application using any type of java applications such as console, windows, web, etc, …
- Technology: JDBC
5. Mobile Application
- Java provides two types of mobile applications. They are entry level application, smartphone applications
- Technology: J2ME, Android
IDE Support
- Java programs can be created using either manual or automatic approaches such as IDE
- Popular IDEs
- Netbeans IDE, Eclipse IDE
- IntelliJ IDEA, etc, …
SOFTWARE REQUIREMENTS
Language : Java
JDK : JDK 1.0 – 22
Tool : Editor or IDE
Java Version History
- Java includes many JDK versions. They are
- JDK Alpha and Beta (1995)
- JDK 1.0 (23rd Jan 1996)
- JDK 1.1 (19th Feb 1997)
- J2SE 1.2 (8th Dec 1998)
- J2SE 1.3 (8th May 2000)
- J2SE 1.4 (6th Feb 2002)
- J2SE 5.0 (30th Sep 2004)
- Java SE 6 (11th Dec 2006)
- Java SE 7 (28th July 2011)
- Java SE 8 (18th March 2014)
- Java SE 9 (21st Sep 2017)
- Java SE 10 (20th March 2018)
- Java SE 11 (25th September 2018)
- Java SE 12 (19th March 2019)
- Java SE 13 (17th September 2019)
- Java SE 14 (17th March 2020)
- Java SE 15 (16th September 2020)
- Java SE 16 (16th March 2021)
- Java SE 17 (14th September 2021)
- Java SE 18 (22nd March 2022)
- Java SE 19 (20th September 2022)
- Java SE 20 (21st March 2023)
- Java SE 21 (19th September 2023)
- Java SE 22 (19th March 2024)
JAVA PLATFORM
- JVM and APIs (Application Programming Interface) together are referred as the “Java Platform”
APIs
- A collection of compiled code that can be included in a source program
- used to give several ready-made solutions for our tasks that need to be frequently performed
FAMILY OF JAVA
- Java is derived from C and C++
- C gives the syntax and C++ gives the oops concepts
JAVA EDITIONS
- Java supports three different editions. They are
- J2SE (Java to Standard Edition) – Supports core java features
- J2EE (Java to Enterprise Edition) – Supports enterprise technology
- J2ME (Java to Micro Edition) – Supports mobile applications.
MORE TUTORIALS