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