Docsity

Introduction to Java Programming - Prof. Vijay, Slides of Engineering

Partial preview of the text

Download Introduction to Java Programming - Prof. Vijay and more Slides Engineering in PDF only on Docsity!

Java

UNIT 1

What is Java?

  • (^) Java is a programming language and a platform. Java is a high level, robust, object-oriented and secure programming language.
  • (^) Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was already a registered company, so James Gosling and his team changed the name from Oak to Java.
  • (^) Platform : Any hardware or software environment in which a program runs, is known as a platform. Since Java has a runtime environment (JRE) and API, it is called a platform.
  • (^) class keyword is used to declare a class in Java.
  • (^) public keyword is an access modifier that represents visibility. It means it is visible to all.
  • (^) static is a keyword. If we declare any method as static, it is known as the static method. The core advantage of the static method is that there is no need to create an object to invoke the static method. The main() method is executed by the JVM, so it doesn't require creating an object to invoke the main() method. So, it saves memory.
  • (^) void is the return type of the method. It means it doesn't return any value.
  • (^) main represents the starting point of the program.
  • (^) String[] args or String args[] is used for command line argument.
  • (^) System.out.println() is used to print statement. Here, System is a class, out is an object of the PrintStream class, println() is a method of the PrintStream class. We will discuss the internal working of System.out.println()

Application

  • (^) Desktop Applications such as acrobat reader, media player, antivirus, etc.
  • (^) Web Applications such as irctc.co.in.,
  • (^) Enterprise Applications such as banking applications.
  • (^) Mobile
  • (^) Embedded System
  • (^) Smart Card
  • (^) Robotics
  • (^) Games, etc.

Java Platforms / Editions

  1. Java SE (Java Standard Edition)- java.lang, java.io, java.net, java.util, java.sql, java.math etc.
  2. Java EE (Java Enterprise Edition)- Servlet, JSP, Web Services, EJB, etc.
  3. Java ME (Java Micro Edition)- mobile applications.
  4. JavaFX - Internet applications

Java Version

  • (^) 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 Mar 2014)
  • (^) Java SE 9 (21st Sep 2017)
  • (^) Java SE 10 (20th Mar 2018)
  • (^) Java SE 11 (September 2018)
  • Java SE 12 (March 2019)
  • Java SE 13 (September 2019)
  • (^) Java SE 14 (Mar 2020)
  • (^) Java SE 15 (September 2020)
  • (^) Java SE 16 (Mar 2021)
  • Java SE 17 (September 2021)
  • Java SE 18 (to be released by March 2022)

JVM (Java Virtual Machine)

  • (^) JVM (Java Virtual Machine) is an abstract machine. It is called a virtual machine because it doesn't physically exist. It is a specification that provides a runtime environment in which Java bytecode can be executed. It can also run those programs which are written in other languages and compiled to Java bytecode.
  1. Loads code
  2. Verifies code
  3. Executes code
  4. Provides runtime environment

JVM (Java Virtual Machine) Architecture

JDK-Java Development Kit

  • (^) The Java Development Kit (JDK) is a software development environment which is used to develop Java applications and applets. It physically exists. It contains JRE + development tools.
  • (^) JDK is an implementation of any one of the below given Java Platforms released by Oracle Corporation:
  1. Standard Edition Java Platform
  2. Enterprise Edition Java Platform
  3. Micro Edition Java Platform

Object-oriented programming (OOPs)

  • (^) Object
  • (^) Class
  • (^) Inheritance
  • (^) Polymorphism
  • (^) Abstraction
  • (^) Encapsulation

Platform Independent

C vs C++ vs Java