Java Notes - Unit 1 Chapter 1-1
Java Notes - Unit 1 Chapter 1-1
Course Outcomes :
Course Prerequisites
Basic Programming Concepts
Procedural Programming
Understanding Algorithms and Problem Solving
Memory Management
Data Structures
Basic Command-Line Usage
Understanding of Databases
Syllabus
Unit - 1
• Introduction: Why Java, History of Java, JVM, JRE, Java Environment, Java
Source File Structure, and Compilation. Fundamental,
• Programming Structures in Java: Defining Classes in Java, Constructors, Methods,
Access Specifies, Static Members, Final Members, Comments, Data types,
Variables, Operators, Control Flow, Arrays & String.
• Object Oriented Programming: Class, Object, Inheritance Super Class, Sub Class,
Overriding, Overloading, Encapsulation, Polymorphism, Abstraction, Interfaces,
and Abstract Class.
• Packages: Defining Package, CLASSPATH Setting for Packages, Making JAR
Files for Library Packages, Import and Static Import Naming Convention For
Packages
• Lecture Objectives
To understand Java data types, variables, Control Flow, Operators,
Methods and Access Specifiers for java program. The application and
functionality of above concepts in java programs.
Department of Applied Computational Science & Engg.
Course Code : Course Name:
• Lecture Outcomes
Develop the object-oriented programming concept using Java
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
A programming Language
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
History of Java
What is JAVA?
An Object Oriented Programming Language
• The object-oriented programming is basically a computer programming
design philosophy or methodology that organizes/ models software design
around data, or objects rather than functions and logic.
• An object is referred to as a data field that has unique attributes and
behaviour. Everything in OOP is grouped as self-sustainable objects.
• It is the most popular programming model among developers. It is well
suited for programs that are large, complex, and actively updated or
maintained. It simplifies software development and maintenance by
providing major concepts such as abstraction, inheritance, polymorphism,
and encapsulation. These core concepts support OOP.
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
Features of OOP - Java
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
Object Oriented Programming Concepts - Java
There are some basic concepts that act as the building blocks of
OOPs i.e.
1. Class
2. Objects
3. Encapsulation
4. Abstraction
5. Polymorphism
6. Inheritance
7. Dynamic Binding
8. Message Passing
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
Java Program Running Structure
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
JVM (Java Virtual Machine)
1. A specification where working of Java Virtual Machine is specified. But implementation provider is
independent to choose the algorithm. Its implementation has been provided by Oracle and other
companies.
2. An implementation Its implementation is known as JRE (Java Runtime Environment).
3. Runtime Instance Whenever you write java command on the command prompt to run the java class,
an instance of JVM is created.
What it does
• The JVM performs following operation:
• Loads code
• Verifies code
• Executes code
• Provides runtime environment
JVM provides definitions for the:
• Memory area
• Class file format
• Register set
• Garbage-collected heap
• Fatal error reporting etc
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
JIT (Just in Time)
What is JAVA?
JIT (Just in Time)
What is JAVA?
JRE (Java Runtime Environment)
The Java Runtime Environment (JRE) is software that Java programs require to run
correctly. Java is a computer language that powers many current web and mobile
applications. The JRE is the underlying technology that communicates between the Java
program and the operating system. It acts as a translator and facilitator, providing all the
resources so that once you write Java software, it runs on any operating system without
further modifications.
A software program needs a runtime environment that provides access to memory and
other system resources such as program files and dependencies. In the past, most
software used the operating system directly as its runtime environment. However, this
meant that developers had to write different code for each operating system that they
wanted their applications to run on. The Java Runtime Environment (JRE) technology
was created as a solution to this problem.
The JRE is actually one of three Java platform components that are required for any Java
program to run successfully. The Java Development Kit (JDK) and Java Virtual Machine
(JVM) are the other two components.
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
Java Environment
• Windows 10 and Windows 8
1. In Search, search for and then select: System (Control Panel)
2. Click the Advanced system settings link.
3. Click Environment Variables. In the section System Variables find
the PATH environment variable and select it. Click Edit. If
the PATH environment variable does not exist, click New.
4. In the Edit System Variable (or New System Variable) window, specify the
value of the PATH environment variable. Click OK. Close all remaining
windows by clicking OK.
5. Reopen Command prompt window, and run your java code.
• Solaris and Linux
1. To find out if the path is properly set:
In a terminal windows, enter:
% java -version
This will print the version of the java tool, if it can find it. If the version is old
or you get the error java: Command not found then the path is not properly
set.
2. Determine which java executable is the first one found in your PATH
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
Java Environment
• Windows 10 and Windows 8
1. In Search, search for and then select: System (Control Panel)
2. Click the Advanced system settings link.
3. Click Environment Variables. In the section System Variables find
the PATH environment variable and select it. Click Edit. If
the PATH environment variable does not exist, click New.
4. In the Edit System Variable (or New System Variable) window, specify the
value of the PATH environment variable. Click OK. Close all remaining
windows by clicking OK.
5. Reopen Command prompt window, and run your java code.
• Solaris and Linux
1. To find out if the path is properly set:
In a terminal windows, enter:
% java -version
This will print the version of the java tool, if it can find it. If the version is old
or you get the error java: Command not found then the path is not properly
set.
2. Determine which java executable is the first one found in your PATH
Department of Applied Computational Science & Engg.
Course Code : Course Name:
What is JAVA?
Java Source File Structure
Recommended Books
Text books
Reference Book