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

Java

The document provides an overview of Object-Oriented Programming (OOP) principles, contrasting them with Procedure-Oriented Languages. Key OOP principles include data abstraction, encapsulation, inheritance, and polymorphism, emphasizing data security and error handling. It also discusses the creation of classes and objects, character encoding systems like ASCII and Unicode, and escape sequences used in programming.

Uploaded by

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

Java

The document provides an overview of Object-Oriented Programming (OOP) principles, contrasting them with Procedure-Oriented Languages. Key OOP principles include data abstraction, encapsulation, inheritance, and polymorphism, emphasizing data security and error handling. It also discusses the creation of classes and objects, character encoding systems like ASCII and Unicode, and escape sequences used in programming.

Uploaded by

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

JAVA

INTRO OF OOP
Procedure oriented language
1. Emphasis on function or procedure
2. Problems are divided into smaller programs called function
3. Share global data
4. Data move freely from function to function
5. Cause problem in debugging
6. Takes time and length of program increases
7. Ex. BASIC, COBOL, FORTRAN, C
Object oriented language
1. Stress is on data values
2. Data values are secured (data security)
3. Error detection and correction is easier
4. Ex. JAVA, PYTHON, C++

Principles of OOP
a. DATA ABSTRACTION
An act of representing the essential features without knowing the background is
defined as data abstraction. Shortly, implementation of code in order to reduce
complexity is known as data abstraction.
b. ENCAPSULATION
Wrapping of data and functions of an object as a unit that can be used together in
a specific operation is known as encapsulation. The insulation of data that does not
allow it to be accessed directly outside the class premises, although it is available in
the same program, is known as Data Hiding.
c. INHERITANCE
The mechanism in which one class acquires the features of another class is called
inheritance. The class that is inherited is called superclass / base class and one
that inherits from base is called as subclass / derived class or target.
Using this, the components in the base class can be reused to perform some other
task in DERIVED CLASS. This phenomenon is termed as REUSABILITY. It helps to:
A) Write program in less time
B) Takes less memory and storage
C) Program execution faster
d. POLYMORPHISM
It is to use a single function to carry multiple tasks.

OBJECTS AND CLASSES


Objects of class can be created as shown:
1. TvSet(class name) Sony(object) = new TvSet();
2. TvSet LG = new TvSet();

Class is an object factory and user defined data type: Class creates similar objects that
process different characteristics and common behavior. When user creates a class it
becomes a data type for its program.

Object is instance of class: It includes instance variable described within the class and
the data members declared within the class are known as instance variables.

Values and data types


CHARACTER
SETS

Operators (+,-,
Letters (A-Z Delimiters ((),
Digits (0-9) ||, !, *,
and a-z) {},[], . , ; ?)
<,>,<=,==)
ENCODING OF CHARACTERS

ENCODING OF
CHARACTERS

ASCII CODE UNICODE

A) UNICODE
It is wide representation of characters in numeric form. Code contains
hexadecimal digits (16-bits code). It can address 137000 characters. Shortly, it is a
standard encoding system used to encode a character in any computer language.
B) ASCII CODE
It stands for American Standard Code for Information Interchange. Uses 7 bits
code for representing each character. It includes 256 characters:

CODES CHARACTERS
48-57 0-9
65-90 A-Z
97-122 a-z
32 Blank
ESCAPE SEQUENCES
They are characters that control the cursor while displaying on the screen. Each escape
sequence starts with backslash( \ ).

ESCAPE SEQUENCE NON GRAPHIC CHARACTERS


\t Horizontal tab
\v Vertical tab
\\ Backslash
\’ Single quote
\’’ Double quote
\b Backspace
\f Form feed
\0 Null
\r Carriage return
\n New line feed
TOKENS

You might also like