Overview of Java
Session by
Dr. S. Sampath Kumar, AP/CSE
13-07-25 Java Buzzwords 1
Agenda
• Introduction to Java
• Java Architecture
• Identifiers
• Data types
• Keywords
• Scope of a variable
• Sample Program
• Access Modifiers
13-07-25 Java Buzzwords 2
1. Introduction to Java:
• Java was developed by a team led by James Gosling at Sun Microsystems. Sun
Microsystems was purchased by Oracle in 2010.
• Java was designed in 1991 for use in embedded chips in consumer electronic
appliances.
➢Java is a multi-platform and object-oriented language.
➢ Uses:
❖ Android mobile apps, Game Development
❖ Cloud computing, Big Data, Artificial Intelligence
❖ Internet of Things
13 July 2025 Fundamentals of Java 3
Java Language Specification, API, JDK, and IDE
• Java syntax is defined in the Java language specification
• The Application Program Interface (API), also known as library,
contains predefined classes and interfaces for developing Java
programs. The API is still expanding
• The JDK is the software for developing and running Java
programs.
• An IDE is an integrated development environment for rapidly
developing programs.
13 July 2025 Fundamentals of Java 4
Types of Java:
• Java Standard Edition (Java SE) to develop client-side applications. The
applications can run standalone or as applets running from a Web browser.
• Java Enterprise Edition (Java EE) to develop server-side applications, such
as Java servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF).
• Java Micro Edition (Java ME) to develop applications for mobile devices,
embedded application and IoT gadgets.
• JavaFX to develop Desktop applications as well as Rich Internet Applications (RIA). The
applications built in JavaFX, can run on multiple platforms including Web, Mobile and
Desktops
13 July 2025 Fundamentals of Java 5
2. Java Architecture
There are two processes in Java - Compilation and Interpretation.
➢The Java source code goes to the compiler.
➢The Java Compiler converts it into byte codes
➢The bytes codes are then converted into machine code by the JVM
➢The Machine code is executed directly by the machine (Operating System).
13 July 2025 Fundamentals of Java 6
Java Architecture: Code Conversion
13 July 2025 Fundamentals of Java 7
How Java is Platform Independent?
• After compilation of the java program a .class file is
generated.
• Now, this .class file is interpreted by JVM and JVM
converts this .class file into machine code (Binary Code).
• So this is the reason why java is a platform-independent
language because it first generates Bytecode this
Bytecode is further interpreted by JVM which is
a machine depended.
• Note: JVM is platform dependant
13 July 2025 Fundamentals of Java 8
Components of Java Architecture:
➢JVM - Java Virtual Machine
➢JRE - Java Runtime Environment
➢JDK - Java Development Kit
13 July 2025 Fundamentals of Java 9
Java Virtual Machine (JVM):
• JVM is an abstract machine. It is a specification that provides
runtime environment in which java bytecode can be executed.
• JVMs are available for many hardware and software platforms (i.e.
JVM is platform dependent).
• JVM performs the following functions:
➢Loads the code
➢Verifies the code
➢Executes the code
➢Provides runtime environment
13 July 2025 Fundamentals of Java 11
Java Runtime Environment (JRE):
• JRE provides a platform where all the applications like JVM and
other runtime libraries are linked to run your Java Program.
• It builds a runtime environment where you can execute the Java
program.
• The JRE also initiates the JVM for
its execution.
13 July 2025 Fundamentals of Java 12
Java Development Kit (JDK):
• JDK is the set of libraries, compiler, interpreter and other set of tools that will help you to
build the Java program.
• We cannot compile Java program without JDK installed on machine.
• Tools in JDK:
➢ java: it is the launcher for all the java applications.
➢ javac: complier of the java programming languages.
➢ javadoc: it is the API documentation generator.
➢ jar: creates and manage all the JAR files.
13 July 2025 Fundamentals of Java 13
3. Identifier:
• All Java variables must be identified with unique names.
• These unique names are called identifiers.
• Identifiers can be short names (like x and y) or more descriptive
names (age, sum, totalVolume). It is recommended to use
descriptive names in order to create understandable and
maintainable code.
13 July 2025 Fundamentals of Java 14
Rules for Naming Variables:
• Java identifier can contain letters, digits, underscores (_), and
dollar signs ($).
• An identifier must start with a letter, an underscore (_), or a
dollar sign ($). It cannot start with a digit.
➢Identifier cannot contain whitespace
➢An identifier cannot be a keyword.
➢An identifier cannot be true, false, or null.
➢An identifier can be of any length.
➢Since Java is case sensitive, area, Area, and AREA are
all different identifiers.
13 July 2025 Fundamentals of Java 15
4. Data Types:
• Data types specify the different sizes and values that can be
stored in the variable.
13 July 2025 Fundamentals of Java 16
Default Value and Size of Data Types
13 July 2025 Fundamentals of Java 17
5. Keywords
➢There are 61 keywords currently defined in the Java language.
➢Keywords or Reserved words are the words in a language that are
used for some internal process or represent some predefined
actions.
➢In general, these keywords cannot be used as identifiers.
➢Also, beginning with JDK 9, an underscore by itself is considered a
keyword in order to prevent its use as the name of something in
your program.
13 July 2025 Fundamentals of Java 18
List of Java Keywords
13 July 2025 Fundamentals of Java 19
6. Scope of a Variable
• A variable can be declared and defined inside a class, method, or
block.
• It defines the scope of the variable i.e. the visibility or accessibility
of a variable.
• Variable declared inside a block or method are not visible to
outside.
• If we try to do so, we will get a compilation error.
13 July 2025 Fundamentals of Java 20
Example:
public class Demo
{
//instance variable
String name = “Siva";
//class and static variable
static double height= 5.9;
public static void main(String args[])
{
//local variable
int marks = 72;
}
}
13 July 2025 Fundamentals of Java 21
7. Structure of a Java Program
13 July 2025 Fundamentals of Java 22
Comments
➢ Comments can be used to explain Java code, and to make it more
readable.
➢ It can also be used to prevent execution when testing alternative
code.
➢ Single-line Comments
Single-line comments start with two forward slashes (//)
➢ Multi-line Comments
Multi-line comments start with /* and ends with */
13 July 2025 Fundamentals of Java 23
A simple Java Program:
class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello, II CSE
C!");
}
}
Output:
Hello, II CSE C!
13 July 2025 Fundamentals of Java 24
8. Access Modifiers
13 July 2025 Fundamentals of Java 25
8. Access Modifiers
➢Public: We can access the public modifier from within the class,
outside the class, within the package and outside the package.
➢Private: We can access the private modifier only within the same
class and not from outside the class.
➢Protected: We can access the protected modifier within the same
package and also from outside the package with the help of the child
class.
➢Default: We can access the default modifier only within the same
package and not from outside the package. If we do not specify any
access modifier it will automatically consider it as default.
13 July 2025 Fundamentals of Java 26
Class Member Access:
13 July 2025 Fundamentals of Java 27
13-07-25 Java Buzzwords 28