SlideShare a Scribd company logo
Java/J2EE Programming Training
Introduction to Java
Page 1Classification: Restricted
Agenda
• Introduction to java platform
• Java virtual machine
• First java program
• Class declaration
• Object
• Legal identifiers
• Declaring primitives and primitive ranges
• Java Keywords
• Access modifiers
Page 2Classification: Restricted
Introduction to java platform
• Java is a high level, robust, secured and object-oriented programming
language.
• Any hardware or software environment in which a program runs, is known
as a platform. Since Java has its own runtime environment (JRE) and API, it
is called platform.
• Java is a programming language created by James Gosling from Sun
Microsystems (Sun) in 1991. The target of Java is to write a program once
and then run this program on multiple operating systems.
• The first publicly available version of Java (Java 1.0) was released in 1995.
Sun Microsystems was acquired by the Oracle Corporation in 2010.
• Over time new enhanced versions of Java have been released. The current
version of Java is Java 1.8 which is also known as Java 8.
Page 3Classification: Restricted
Introduction to java platform
Page 4Classification: Restricted
Introduction to java platform
• The java program saved as .java file
• Using the java compiler the code is converted into an intermediate code
called the bytecode. The output is a .class file.
• This code is not understood by any platform, but only a virtual platform
called the Java Virtual Machine
• This Virtual Machine resides in the RAM of your operating system. When
the Virtual Machine is fed with this bytecode, it identifies the platform it is
working on and converts the bytecode into the native machine code
• Code once compiled can run not only on all PC platforms but also mobiles
or other electronic gadgets supporting java. Hence, java is a language as
well as a platform (JVM)
Page 5Classification: Restricted
Introduction to Java
• There are mainly 4 types of applications that can be created using java
programming:
• Standalone Application
• Web Application
• Enterprise Application
• Mobile Application
Page 6Classification: Restricted
Java virtual machine
• JVM stands for Java Virtual Machine. It is the engine that drives the Java
Code. It converts Java bytecode into machines language.
• In other programming language, the compiler produces code for a
particular system. But Java compiler produces code for a Virtual Machine.
• In JVM, Java code is compiled into bytecode. This bytecode gets
interpreted on different machines
• JVM is responsible for allocating a memory space.
Page 7Classification: Restricted
First Java program
Page 8Classification: Restricted
Class declaration
• A class is an entity that determines how an object will behave and what
the object will contain. In other words, it is a blueprint or a set of
instruction to build a specific type of object.
Page 9Classification: Restricted
Class declaration
• There can be only one public class per source code file.
• If the class is part of a package, the package statement must be the first line
in the source code file, before any import statements that may be present.
• If there are import statements, they must go between the package
statement (if there is one) and the class declaration.
• import and package statements apply to all classes within a source code
file. In other words, there's no way to declare multiple classes in a file and
have them in different packages, or use different imports.
• A file can have more than one nonpublic class.
• Files with no public classes can have a name that does not match any of the
classes in the file.
Page 10Classification: Restricted
Class declaration
Class
Page 11Classification: Restricted
Object
• Real-world objects share two characteristics: They all have state and behavior.
Dogs have state (name, color, breed, hungry) and behavior (barking, fetching,
wagging tail).
• Software objects are conceptually similar to real-world objects: they too
consist of state and related behavior. An object stores its state
in fields (variables in some programming languages) and exposes its behavior
through methods (functions in some programming languages).
• An object is nothing but a self-contained component which consists of
methods and properties to make a particular type of data useful. Object
determines the behavior of the class. When you send a message to an object,
you are asking the object to invoke or execute one of its methods.
• An object is a specimen of a class. Software objects are often used to model
real-world objects you find in everyday life.
Page 12Classification: Restricted
Legal identifiers
• Identifiers must start with a letter, a currency character ($), or a
connecting character such as the underscore ( _ ). Identifiers cannot
start with a number!
• After the first character, identifiers can contain any combination of
letters, currency characters, connecting characters, or numbers.
• In practice, there is no limit to the number of characters an identifier
can contain.
• Identifiers in Java are case-sensitive; foo and FOO are two different
identifier.
• Exercise:-
• int :b;
• int -d;
• int e#; I
• nt .f;
• int 7g;
Page 13Classification: Restricted
Declaring primitives and primitive ranges
Page 14Classification: Restricted
Java Keywords
Page 15Classification: Restricted
Access modifiers
Modifiers fall into two categories:
 Access modifiers: public, protected, private.
 Non-access modifiers (including strictfp, final, and abstract).
Class Access
One class (class A) has access to another class (class B), it means class A can
do one of three things:
 Create an instance of class B.
 Extend class B (in other words, become a subclass of class B).
 Access certain methods and variables within class B, depending on the access
control of those methods and variables.
Page 16Classification: Restricted
Access modifiers
Class access can have following access modifiers :-
• Default Access
• Public Access
Class access can have following non access modifiers :-
• Final Classes
• Abstract Classes
• Strictfp Classes
Page 17Classification: Restricted
Access modifiers
Class member can have following access modifiers :-
Page 18Classification: Restricted
Access modifiers
Class member can have following non access modifiers :-
• Final Methods
• Abstract Methods
• Synchronized Methods
• Native Methods
• Strictfp methods
Page 19Classification: Restricted
Thank You

More Related Content

PPTX
C sharp
PPTX
PPTX
Object oriented concepts with java
PPTX
The smartpath information systems java
PPTX
PDF
Cs8392 oops 5 units notes
PPSX
Review Session and Attending Java Interviews
PPTX
Structure of java program diff c- cpp and java
C sharp
Object oriented concepts with java
The smartpath information systems java
Cs8392 oops 5 units notes
Review Session and Attending Java Interviews
Structure of java program diff c- cpp and java

What's hot (18)

PDF
Java programming -Object-Oriented Thinking- Inheritance
PPTX
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
PPTX
Packages and Interfaces
PPTX
java training in jaipur|java training|core java training|java training compa...
PPTX
Concept of OOPS with real life examples
PPTX
Polymorphism
PDF
JAVA PROGRAMMING – Packages - Stream based I/O
PPT
Comp102 lec 3
PPSX
Intro to Object Oriented Programming with Java
PPTX
Packages
PPTX
Object Oriented Programming with C#
PPTX
Introduction to Object-Oriented Concepts and Java
PPTX
Classes And Objects
PPT
C sharp
DOCX
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
PPT
OOP in Java
PPT
Inheritance and Polymorphism
PPTX
Java fundamentals 2
Java programming -Object-Oriented Thinking- Inheritance
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
Packages and Interfaces
java training in jaipur|java training|core java training|java training compa...
Concept of OOPS with real life examples
Polymorphism
JAVA PROGRAMMING – Packages - Stream based I/O
Comp102 lec 3
Intro to Object Oriented Programming with Java
Packages
Object Oriented Programming with C#
Introduction to Object-Oriented Concepts and Java
Classes And Objects
C sharp
OBJECT ORIENTED ROGRAMMING With Question And Answer Full
OOP in Java
Inheritance and Polymorphism
Java fundamentals 2
Ad

Similar to Introduction to Java Part-3 (20)

PPTX
Introduction to Java.pptx sjskmdkdmdkdmdkdkd
PPTX
Power Point Presentation on Core Java For the Beginers
PPTX
Introduction to oop and java fundamentals
PPTX
oop unit1.pptx
PPTX
Session 02 - Elements of Java Language
PPSX
Elements of Java Language
PPTX
PPT
PPS Java Overview Unit I.ppt
PPT
PPS Java Overview Unit I.ppt
PPTX
Vb.net basics 1(vb,net--3 year)
PDF
Unit 1 Core Java for Compter Science 3rd
PPTX
JAVA PROGRAMMING-Unit I - Final PPT.pptx
DOC
Java questions and answers jan bask.net
PPT
Object oriented programming_Unit1_Introduction.ppt
PPTX
Core java
PPTX
Unit1 introduction to Java
PPT
JavaClassPresentation
PPTX
Java (1).ppt seminar topics engineering
PDF
java notes.pdf
Introduction to Java.pptx sjskmdkdmdkdmdkdkd
Power Point Presentation on Core Java For the Beginers
Introduction to oop and java fundamentals
oop unit1.pptx
Session 02 - Elements of Java Language
Elements of Java Language
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
Vb.net basics 1(vb,net--3 year)
Unit 1 Core Java for Compter Science 3rd
JAVA PROGRAMMING-Unit I - Final PPT.pptx
Java questions and answers jan bask.net
Object oriented programming_Unit1_Introduction.ppt
Core java
Unit1 introduction to Java
JavaClassPresentation
Java (1).ppt seminar topics engineering
java notes.pdf
Ad

More from RatnaJava (14)

PPTX
Review Session and Attending Java Interviews
PPTX
Collections - Lists & sets
PPTX
Collections - Sorting, Comparing Basics
PPTX
Collections Array list
PPTX
Object Class
PPTX
Exception Handling
PPTX
OOPs with Java - Packaging and Access Modifiers
PPTX
OOP with Java - Abstract Classes and Interfaces
PPTX
OOP with Java - Part 3
PPTX
OOP with Java - continued
PPTX
Object Oriented Programming
PPTX
Data Handling and Function
PPTX
Introduction to Java Part-2
PPTX
Introduction to Java
Review Session and Attending Java Interviews
Collections - Lists & sets
Collections - Sorting, Comparing Basics
Collections Array list
Object Class
Exception Handling
OOPs with Java - Packaging and Access Modifiers
OOP with Java - Abstract Classes and Interfaces
OOP with Java - Part 3
OOP with Java - continued
Object Oriented Programming
Data Handling and Function
Introduction to Java Part-2
Introduction to Java

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation theory and applications.pdf
PDF
KodekX | Application Modernization Development
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Building Integrated photovoltaic BIPV_UPV.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Encapsulation_ Review paper, used for researhc scholars
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation theory and applications.pdf
KodekX | Application Modernization Development
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Introduction to Java Part-3

  • 2. Page 1Classification: Restricted Agenda • Introduction to java platform • Java virtual machine • First java program • Class declaration • Object • Legal identifiers • Declaring primitives and primitive ranges • Java Keywords • Access modifiers
  • 3. Page 2Classification: Restricted Introduction to java platform • Java is a high level, robust, secured and object-oriented programming language. • Any hardware or software environment in which a program runs, is known as a platform. Since Java has its own runtime environment (JRE) and API, it is called platform. • Java is a programming language created by James Gosling from Sun Microsystems (Sun) in 1991. The target of Java is to write a program once and then run this program on multiple operating systems. • The first publicly available version of Java (Java 1.0) was released in 1995. Sun Microsystems was acquired by the Oracle Corporation in 2010. • Over time new enhanced versions of Java have been released. The current version of Java is Java 1.8 which is also known as Java 8.
  • 5. Page 4Classification: Restricted Introduction to java platform • The java program saved as .java file • Using the java compiler the code is converted into an intermediate code called the bytecode. The output is a .class file. • This code is not understood by any platform, but only a virtual platform called the Java Virtual Machine • This Virtual Machine resides in the RAM of your operating system. When the Virtual Machine is fed with this bytecode, it identifies the platform it is working on and converts the bytecode into the native machine code • Code once compiled can run not only on all PC platforms but also mobiles or other electronic gadgets supporting java. Hence, java is a language as well as a platform (JVM)
  • 6. Page 5Classification: Restricted Introduction to Java • There are mainly 4 types of applications that can be created using java programming: • Standalone Application • Web Application • Enterprise Application • Mobile Application
  • 7. Page 6Classification: Restricted Java virtual machine • JVM stands for Java Virtual Machine. It is the engine that drives the Java Code. It converts Java bytecode into machines language. • In other programming language, the compiler produces code for a particular system. But Java compiler produces code for a Virtual Machine. • In JVM, Java code is compiled into bytecode. This bytecode gets interpreted on different machines • JVM is responsible for allocating a memory space.
  • 9. Page 8Classification: Restricted Class declaration • A class is an entity that determines how an object will behave and what the object will contain. In other words, it is a blueprint or a set of instruction to build a specific type of object.
  • 10. Page 9Classification: Restricted Class declaration • There can be only one public class per source code file. • If the class is part of a package, the package statement must be the first line in the source code file, before any import statements that may be present. • If there are import statements, they must go between the package statement (if there is one) and the class declaration. • import and package statements apply to all classes within a source code file. In other words, there's no way to declare multiple classes in a file and have them in different packages, or use different imports. • A file can have more than one nonpublic class. • Files with no public classes can have a name that does not match any of the classes in the file.
  • 12. Page 11Classification: Restricted Object • Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). • Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). • An object is nothing but a self-contained component which consists of methods and properties to make a particular type of data useful. Object determines the behavior of the class. When you send a message to an object, you are asking the object to invoke or execute one of its methods. • An object is a specimen of a class. Software objects are often used to model real-world objects you find in everyday life.
  • 13. Page 12Classification: Restricted Legal identifiers • Identifiers must start with a letter, a currency character ($), or a connecting character such as the underscore ( _ ). Identifiers cannot start with a number! • After the first character, identifiers can contain any combination of letters, currency characters, connecting characters, or numbers. • In practice, there is no limit to the number of characters an identifier can contain. • Identifiers in Java are case-sensitive; foo and FOO are two different identifier. • Exercise:- • int :b; • int -d; • int e#; I • nt .f; • int 7g;
  • 14. Page 13Classification: Restricted Declaring primitives and primitive ranges
  • 16. Page 15Classification: Restricted Access modifiers Modifiers fall into two categories:  Access modifiers: public, protected, private.  Non-access modifiers (including strictfp, final, and abstract). Class Access One class (class A) has access to another class (class B), it means class A can do one of three things:  Create an instance of class B.  Extend class B (in other words, become a subclass of class B).  Access certain methods and variables within class B, depending on the access control of those methods and variables.
  • 17. Page 16Classification: Restricted Access modifiers Class access can have following access modifiers :- • Default Access • Public Access Class access can have following non access modifiers :- • Final Classes • Abstract Classes • Strictfp Classes
  • 18. Page 17Classification: Restricted Access modifiers Class member can have following access modifiers :-
  • 19. Page 18Classification: Restricted Access modifiers Class member can have following non access modifiers :- • Final Methods • Abstract Methods • Synchronized Methods • Native Methods • Strictfp methods