Lecture 1 Introduction
Lecture 1 Introduction
Source: https://www.zdnet.com/article/top-programming-languages-most-popular-and-fastest-growing-choices-for-developers/
Introduction to JAVA Programming
• Java is a class based, high-level, object-oriented programming language
developed by Sun Microsystems of the USA in 1991.
• It was originally called Oak by James Goslin. He was one of the inventors of
Java.
• JAVA was acquired by Oracle in year 2009.
• The aim of developing java language was to create a simple, reliable, and
portable language.
• Java = Object-Oriented (all programs follows the concept of OOPS and classes
are created whenever you have to create any program)
• It does not uses Procedural Oriented Language.
Is JAVA Pure/Complete Object Oriented Language?
For a language to be called as a Pure Object Oriented Language, it must fulfill
following 7 properties:
1. Encapsulation/Data Hiding
2. Inheritance
3. Polymorphism
4. Abstraction
5. All predefined types are objects
6. All user defined types are objects
7. All operations performed on objects must be only through methods
exposed at the objects.
However, Out of above 7 properties, JAVA follows all except Property 5 and 7.
Because of this reason, JAVA is not a Pure/Complete Object Oriented Language.
Categories/Flavors of JAVA
• JAVA Programming languages is used in different application areas.
• JAVA can be used for :
1. Software Development (Core JAVA) (J2SE)
2. Website Development (Advanced JAVA) (J2EE)
3. Android Application Development (J2ME)
Why to Learn JAVA/ Features of JAVA
Following features of JAVA makes it a powerful Language:
• Simple and easy to Learn
• Platform Independent Language: because it does not depend on any type of platform. In
Java, programs are compiled into byte code and that byte code is platform-independent The
program can be executed in any Computer, no matter on which OS it was created and
compiled.
• Secure: Supports exception handling, programs run inside JVM (sandbox), support of
security APIs, compile time checking, etc.
• Compiled and Interpreted Language: Source code is compiled and converted to bytecode,
and then bytecode is given to interpreter (JVM) which generates the output.
• Robust: Because of concepts like Garbage Collector (destroys unused objects and frees
memory automatically), Exception Handling, etc.
• Huge Libraries and Frameworks Support
How JAVA Program Works?
• Java is compiled into the bytecode and then it is interpreted to
machine code.
• Java is both compiled as well as interpreted language.
How JAVA Program Works?
Java Installation
• Go to Google & type “Install JDK” (Installs Java JDK) (JAVA 17 is the
latest version).
• Go to Google & type “Install IntelliJ Idea” (Installs Java IDE)
• Jcreator, netbeans
• JDK – Java Development Kit = Collection of tools used for developing
java applications, and contains numerous development tools like
compilers, debuggers, etc.
• JRE – Java Runtime Environment = Helps in executing programs
developed in JAVA. It is used for implementation of JVM(Java Virtual
Machine)
Understanding the Structure of a JAVA Program
Main() Function is the entry point of your
java program.
JVM runs everything between the curly
braces { } of your main method.
2. java Musharaf
How to Execute a Program in Java
Basic Structure of a JAVA Program
A JAVA program consists of: