SlideShare a Scribd company logo
JVM and OOPS Introduction
JVM and OOPS Introduction
 static Keyword : 
◦ The static keyword is used in java mainly for memory 
management. 
 Types Of Static Members : 
◦ Java supporting four types of static members 
1. static variables 
2. static blocks 
3. static methods 
4. main method
 Non-static Members : 
◦ Class level members which don’t have static keyword in their 
creation statement are called non-static members. 
 Types Of Non-static Members : 
◦ Java supporting four types of non-static members 
1. Non-static variables 
2. Non-static blocks 
3. Non-static methods 
4. Constructors
 Package: 
◦ It is a Java folder used to group related classes , interfaces 
and enums. 
 Class : 
◦ Class is a collection of data members and member functions 
 Interface : 
◦ Interface is a fully unimplemented class , it is used for 
defining set of object operations. 
 Abstract Class : 
◦ A class that is declared with abstract keyword, is known as 
abstract class in java
 DataType : 
◦ Data type gives information about size of the memory location 
and range of data that can be stored inside that location . 
1. Primitive types 
2. Referenced types 
 Primitive Types: 
◦ Primitive Data types is used to store single value at a time.
Size and Default value of Primitive type: 
Data Type Name Size [ byte( s ) ] Default Value 
byte 1 0 
short 2 0 
int 4 0 
long 8 0 
float 4 0.0 
double 8 0.0 
char 2 ‘u0000' 
boolean 1 false
 Types of Loop : 
◦Java has very flexible three looping mechanisms. 
1. while loop 
2. do…while 
3. for loop 
 Enhanced for Loop : 
Syntax : 
for (data_type variable: array_name){ 
--------- 
--------- 
}
 Switch-case: 
◦ A switch statement allows you to test the value of an 
expression and, depending on that value, to jump directly to 
some location within the switch statement. 
 Syntax: switch (expression) { 
case value1: 
//statement s 
break; 
------------------------ 
case value n: 
//statements 
default: 
//default statement sequence 
}
 Using String in Switch-case: 
◦ In Java SE 7 and later, you can use a String object in 
the switch statement's expression. 
 Use of instanceof keyword: 
◦ The instanceof operator allows you to determine the type of 
an object. 
Example:- if(employee instanceof Person){ 
--------------------- 
--------------------- 
}
 Class: 
oA class can be defined as a template/blue print that describes 
the behaviours/states that object of its type support. 
 Syntax to declare a class: 
class <class_name>{ 
data member; 
method; 
} 
 Object: 
◦ object is the physical reality of a class. 
 Object’s characteristics : 
1.State 
2.Behaviour 
3.Identity
 Relationship with Objects: 
◦ Java supports three types of relationship: 
1.IS-A.(Inheritance) 
2.HAS-A.(Composition) 
3.USES-A.(Aggregation) 
 OOPs Features: 
◦ We have mainly four OOPs Features: 
1.Encapsulation 
2. Inheritance 
3. Abstraction 
4. Polymorphism
 Encapsulation: 
◦ The process of creating a class by Hiding internal data from 
the outside. 
 Inheritance: 
◦ The process of creating a class to reuse exited class member 
using our class name or objects is called inheritance.
 Abstraction : 
◦ The process of defining a class by providing necessary 
details to class objects operation by hiding or removing its 
implementation details called abstraction. 
 Polymorphism: 
◦ The process of defining a class by with multiple methods 
with same name but different implementation is called 
polymorphism. 
 Types of Polymorphism: 
1. Compile-time polymorphism. 
2. Run-time polymorphism.
 Behaviors of Polymorphism: 
◦ we can developed polymorphism by using 
1. Method Overloading. 
2. Method Overriding 
 Return Type Declaration: 
◦ Use the return statement to return the value. 
◦ Declare a method's return type in its method declaration. 
◦ Declare Within the body of the method.
JVM and OOPS Introduction
 Types Of Constructor: 
◦ Default constructor (no-argument constructor): 
A constructor that have no parameters 
Ex- 
◦ Parameterized constructor: 
A constructor that have parameters
 Constructor Overloading: 
◦ A class can have any number of constructors that differ in 
parameter lists. 
 Constructor Chaining: 
◦ Calling one constructor from other. 
 this Keyword: 
◦ this is a reference variable that refers to the current object. 
 super Keyword : 
◦ super is a reference variable that is used to refer immediate 
parent class object.
JVM and OOPS Introduction
 Array: 
◦ Array is a collection of similar type of elements that have 
continuous memory location. 
 Array Declaration: 
◦ 1 Dimensional Declaration- 
Ex-int[] x; 
◦ 2 Dimensional Declaration- 
Ex-int[][] x;
 Array Initialization : 
◦ Syntax- 
Datatype arrayName = new datatype[size]; 
 Array Assignment : 
◦ Syntax- 
DataType[] arrayRefVar = {value0, value1, ..., value 
k}; 
 Anonymous Array: 
◦ Array without any name. 
◦ Syntax-new 
datatype[]{10,20,30};
JVM and OOPS Introduction

More Related Content

PPTX
Java String
PPTX
What is String in Java?
PDF
Java String
PDF
StringTokenizer in java
PPTX
PPTX
String Builder & String Buffer (Java Programming)
PPS
String and string buffer
PPTX
String, string builder, string buffer
Java String
What is String in Java?
Java String
StringTokenizer in java
String Builder & String Buffer (Java Programming)
String and string buffer
String, string builder, string buffer

What's hot (20)

PDF
Arrays string handling java packages
PPTX
Introduction to Java Strings, By Kavita Ganesan
PPTX
Autoboxing And Unboxing In Java
PPS
Wrapper class
PPTX
Java Strings
PPT
String classes and its methods.20
PPT
Chapter 9 - Characters and Strings
PPT
Chapter 7 String
PPT
Wrapper class (130240116056)
PPT
String handling session 5
PDF
Java Strings Tutorial | String Manipulation in Java | Java Tutorial For Begin...
PPTX
Java strings
DOCX
Autoboxing and unboxing
PPTX
L9 wrapper classes
PPTX
Java string handling
PPTX
Strings in Java
PPT
Classes & objects new
PDF
Java Wrapper Classes and I/O Mechanisms
PPTX
JSpiders - Wrapper classes
Arrays string handling java packages
Introduction to Java Strings, By Kavita Ganesan
Autoboxing And Unboxing In Java
Wrapper class
Java Strings
String classes and its methods.20
Chapter 9 - Characters and Strings
Chapter 7 String
Wrapper class (130240116056)
String handling session 5
Java Strings Tutorial | String Manipulation in Java | Java Tutorial For Begin...
Java strings
Autoboxing and unboxing
L9 wrapper classes
Java string handling
Strings in Java
Classes & objects new
Java Wrapper Classes and I/O Mechanisms
JSpiders - Wrapper classes
Ad

Viewers also liked (20)

PDF
Intro To Regex In Java
PPTX
java:characteristics, classpath, compliation
PPTX
This keyword in java
PPT
Regular Expression
PDF
Java Course 3: OOP
PDF
Java Course 1: Introduction
PPT
Java: Objects and Object References
PPT
Regular Expression
PPT
Java: Class Design Examples
PPT
Object and Classes in Java
PDF
Java Course 5: Enums, Generics, Assertions
PDF
Simple Pure Java
PPT
String Handling
PPTX
Java static keyword
PPT
Java features
PDF
Java Arrays
ODP
Java Collections
PDF
Java Collection framework
PDF
Java Collections API
Intro To Regex In Java
java:characteristics, classpath, compliation
This keyword in java
Regular Expression
Java Course 3: OOP
Java Course 1: Introduction
Java: Objects and Object References
Regular Expression
Java: Class Design Examples
Object and Classes in Java
Java Course 5: Enums, Generics, Assertions
Simple Pure Java
String Handling
Java static keyword
Java features
Java Arrays
Java Collections
Java Collection framework
Java Collections API
Ad

Similar to JVM and OOPS Introduction (20)

PDF
JAVA Class Presentation.pdf Vsjsjsnheheh
PPTX
Object oriented programming in java
PPTX
PDF
7. VARIABLEs presentation in java programming. Pdf
PPT
core_java.ppt
PPTX
Java Tokens in java program . pptx
PPTX
class as the basis.pptx
PDF
Java unit 7
PPTX
Learning core java
PPTX
Java As an OOP Language,Exception Handling & Applets
PPTX
Android Training (Java Review)
PPTX
Statics in java | Constructors | Exceptions in Java | String in java| class 3
PPTX
Quick Interview Preparation for C# All Concepts
PPT
Md02 - Getting Started part-2
PDF
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
PDF
Core Java Introduction | Basics
PPTX
C# classes objects
PPTX
PPT Lecture-1.4.pptx
PPTX
UNIT 3- Java- Inheritance, Multithreading.pptx
PPTX
JAVA programming language made easy.pptx
JAVA Class Presentation.pdf Vsjsjsnheheh
Object oriented programming in java
7. VARIABLEs presentation in java programming. Pdf
core_java.ppt
Java Tokens in java program . pptx
class as the basis.pptx
Java unit 7
Learning core java
Java As an OOP Language,Exception Handling & Applets
Android Training (Java Review)
Statics in java | Constructors | Exceptions in Java | String in java| class 3
Quick Interview Preparation for C# All Concepts
Md02 - Getting Started part-2
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Core Java Introduction | Basics
C# classes objects
PPT Lecture-1.4.pptx
UNIT 3- Java- Inheritance, Multithreading.pptx
JAVA programming language made easy.pptx

Recently uploaded (20)

PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPT
Project quality management in manufacturing
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPT
introduction to datamining and warehousing
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Current and future trends in Computer Vision.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
web development for engineering and engineering
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Internet of Things (IOT) - A guide to understanding
Project quality management in manufacturing
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
introduction to datamining and warehousing
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Current and future trends in Computer Vision.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
web development for engineering and engineering
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
R24 SURVEYING LAB MANUAL for civil enggi
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
OOP with Java - Java Introduction (Basics)
UNIT 4 Total Quality Management .pptx
bas. eng. economics group 4 presentation 1.pptx

JVM and OOPS Introduction

  • 3.  static Keyword : ◦ The static keyword is used in java mainly for memory management.  Types Of Static Members : ◦ Java supporting four types of static members 1. static variables 2. static blocks 3. static methods 4. main method
  • 4.  Non-static Members : ◦ Class level members which don’t have static keyword in their creation statement are called non-static members.  Types Of Non-static Members : ◦ Java supporting four types of non-static members 1. Non-static variables 2. Non-static blocks 3. Non-static methods 4. Constructors
  • 5.  Package: ◦ It is a Java folder used to group related classes , interfaces and enums.  Class : ◦ Class is a collection of data members and member functions  Interface : ◦ Interface is a fully unimplemented class , it is used for defining set of object operations.  Abstract Class : ◦ A class that is declared with abstract keyword, is known as abstract class in java
  • 6.  DataType : ◦ Data type gives information about size of the memory location and range of data that can be stored inside that location . 1. Primitive types 2. Referenced types  Primitive Types: ◦ Primitive Data types is used to store single value at a time.
  • 7. Size and Default value of Primitive type: Data Type Name Size [ byte( s ) ] Default Value byte 1 0 short 2 0 int 4 0 long 8 0 float 4 0.0 double 8 0.0 char 2 ‘u0000' boolean 1 false
  • 8.  Types of Loop : ◦Java has very flexible three looping mechanisms. 1. while loop 2. do…while 3. for loop  Enhanced for Loop : Syntax : for (data_type variable: array_name){ --------- --------- }
  • 9.  Switch-case: ◦ A switch statement allows you to test the value of an expression and, depending on that value, to jump directly to some location within the switch statement.  Syntax: switch (expression) { case value1: //statement s break; ------------------------ case value n: //statements default: //default statement sequence }
  • 10.  Using String in Switch-case: ◦ In Java SE 7 and later, you can use a String object in the switch statement's expression.  Use of instanceof keyword: ◦ The instanceof operator allows you to determine the type of an object. Example:- if(employee instanceof Person){ --------------------- --------------------- }
  • 11.  Class: oA class can be defined as a template/blue print that describes the behaviours/states that object of its type support.  Syntax to declare a class: class <class_name>{ data member; method; }  Object: ◦ object is the physical reality of a class.  Object’s characteristics : 1.State 2.Behaviour 3.Identity
  • 12.  Relationship with Objects: ◦ Java supports three types of relationship: 1.IS-A.(Inheritance) 2.HAS-A.(Composition) 3.USES-A.(Aggregation)  OOPs Features: ◦ We have mainly four OOPs Features: 1.Encapsulation 2. Inheritance 3. Abstraction 4. Polymorphism
  • 13.  Encapsulation: ◦ The process of creating a class by Hiding internal data from the outside.  Inheritance: ◦ The process of creating a class to reuse exited class member using our class name or objects is called inheritance.
  • 14.  Abstraction : ◦ The process of defining a class by providing necessary details to class objects operation by hiding or removing its implementation details called abstraction.  Polymorphism: ◦ The process of defining a class by with multiple methods with same name but different implementation is called polymorphism.  Types of Polymorphism: 1. Compile-time polymorphism. 2. Run-time polymorphism.
  • 15.  Behaviors of Polymorphism: ◦ we can developed polymorphism by using 1. Method Overloading. 2. Method Overriding  Return Type Declaration: ◦ Use the return statement to return the value. ◦ Declare a method's return type in its method declaration. ◦ Declare Within the body of the method.
  • 17.  Types Of Constructor: ◦ Default constructor (no-argument constructor): A constructor that have no parameters Ex- ◦ Parameterized constructor: A constructor that have parameters
  • 18.  Constructor Overloading: ◦ A class can have any number of constructors that differ in parameter lists.  Constructor Chaining: ◦ Calling one constructor from other.  this Keyword: ◦ this is a reference variable that refers to the current object.  super Keyword : ◦ super is a reference variable that is used to refer immediate parent class object.
  • 20.  Array: ◦ Array is a collection of similar type of elements that have continuous memory location.  Array Declaration: ◦ 1 Dimensional Declaration- Ex-int[] x; ◦ 2 Dimensional Declaration- Ex-int[][] x;
  • 21.  Array Initialization : ◦ Syntax- Datatype arrayName = new datatype[size];  Array Assignment : ◦ Syntax- DataType[] arrayRefVar = {value0, value1, ..., value k};  Anonymous Array: ◦ Array without any name. ◦ Syntax-new datatype[]{10,20,30};