0% found this document useful (0 votes)
3 views16 pages

OOPs - Lecture 03 - OOPs Concept, Datatypes, Variables

The document outlines key concepts of Object-Oriented Programming (OOP) including encapsulation, inheritance, abstraction, and polymorphism, along with their real-world applications. It also discusses lexical issues in Java, keywords, and data types, distinguishing between primitive and reference/object data types. Additionally, it explains the definition and types of variables in Java programming.

Uploaded by

1originaltruth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views16 pages

OOPs - Lecture 03 - OOPs Concept, Datatypes, Variables

The document outlines key concepts of Object-Oriented Programming (OOP) including encapsulation, inheritance, abstraction, and polymorphism, along with their real-world applications. It also discusses lexical issues in Java, keywords, and data types, distinguishing between primitive and reference/object data types. Additionally, it explains the definition and types of variables in Java programming.

Uploaded by

1originaltruth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

OOPs Concept,

Keywords, Data Types,


Variable

Lecture 03
Learning Outcome
After the completion of today’s lecture you will be able to:
• Illustrate all the OOPs concepts.
• Relate the OOPs concept with real world examples.
• Learn the lexical issues in java
• List various keywords in java
OOPs concepts

Encapsulation

Inheritance OOPs Abstraction

Polymorphism
Abstraction
• Abstraction means showing essential features and hiding non-essential features
to the user.
• It is used to manage complexity easily.
• eg
Encapsulation
• Encapsulation means which binds the data and code (or) writing operations and
methods in single unit.
• Encapsulation is the mechanism that binds together code and the data it
manipulates, and keeps both safe from outside interference and misuse.
• eg
Polymorphism
• Polymorphism (from Greek, meaning “many forms”) is a feature that allows one
interface to be used for a general class of actions.
• The specific action is determined by the exact nature of the situation.
• Polymorphism means ability to take more than one form that an operation can
exhibit different behavior at different instance depend upon the data passed in
the operation.
• eg
Inheritance
• Inheritance is the process by which one object acquires the properties of another
object.
• This is important because it supports the concept of hierarchical classification.
• eg
Lexical issues
• Whitespaces: No indentation required. All can be written in one line.
• Identifiers: Identifiers are used to name things, such as classes,
variables, and methods. An identifier may be any descriptive
sequence of uppercase and lowercase letters, numbers, or the
underscore and dollar-sign characters. (The dollar-sign character is
not intended for general use.) They must not begin with a number,
lest they be confused with a numeric literal.
• Literals: A constant value in Java is created by using a literal
representation of it.
Java Keywords
Datatypes in Java

Data Types

Primitive Reference/Object
Primitive data types
• Integers This group includes byte, short, int, and long, which are for
whole-valued signed numbers.
• Floating-point numbers This group includes float and double, which
represent numbers with fractional precision.
• Characters This group includes char, which represents symbols in a
character set, like letters and numbers.
• Boolean This group includes boolean, which is a special type for
representing true/false values.
Reference/Object Data type
• These are created or developed by programmers.
• Eg.
Employee e;
Where Employee is a class and “e” is an object of the class.
So, here e is the reference/object data types.
Variables
• The variable is the basic unit of storage in a Java program.
• A variable is defined by the combination of an identifier, a type, and
an optional initializer.
• Java supports dynamic initialization
Eg:
Types of variable
Class A
{
Instance
Variable

int inst; //instance variable


static int a = 10;//static variable
Local void fun()
{
Static int x = 100;//local variable
}
}
Read by yourself
• Operators in java
• Control Statements
• Iteration Statements
Thanks

You might also like