Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Java Programming notes

Rating
-
Sold
-
Pages
84
Uploaded on
17-09-2024
Written in
2024/2025

The above notes prescribed for beginners who want to start the journey in java from the depth. This is chapter 1. Remaining Chapters will uploded in future. THANK YOU.

Institution
Course

Content preview

Panimalar Engineering College 1. 1

UNIT 1 INTORDUCTION TO OOP AND JAVA FUNDAMENTALS

Object Oriented Programming - Abstraction – Objects And Classes - Encapsulation- Inheritance -
Polymorphism- characteristics of Java-Java Environment- Java source File- compilation –
Fundamental Programming Structures In Java –Data types-variables-operators-control flow- Defining
Classes In Java – Constructors, Methods -Access Specifiers - Static Members - Arrays , Javadoc
Comments.

1.1: Object Oriented Programming

 PROCEDURE-ORIENTED PROGRAMMING [POP]:

Procedure-Oriented Programming is a conventional programming which consists of
writing a list of instructions for the computer to follow and organizing these
instructions into groups known as Functions (or) Procedures (or) subroutines (or)
Modules.

Example: A program may involve the following operations:
 Collecting data from user (Reading)
 Calculations on collected data (Calculation)
 Displaying the result to the user (Printing)


Main Program
Global Data




Procedure
Procedure Procedure
3(Printing)
1(Reading) 2(Calculation)
Local Data Local Data Local Data



Characteristics of Procedural oriented programming:-

1. It focuses on process rather than data.
2. It takes a problem as a sequence of things to be done such as reading,
calculating and printing. Hence, a number of functions are written to solve a
problem.
3. A program is divided into a number of functions and each function has clearly
defined purpose.
4. Most of the functions share global data.
5. Data moves openly around the system from function to function.


23IT1301 – Object Oriented Programming Unit - 1 III SEMESTER CSE

,Panimalar Engineering College 1. 2


6. Employs top-down approach in program design.
Drawback of POP

 Procedural languages are difficult to relate with the real world objects.
 Procedural codes are very difficult to maintain, if the code grows larger.
 Procedural languages do not have automatic memory management as like in Java.
Hence, it makes the programmer to concern more about the memory management
of the program.
 The data, which is used in procedural languages, are exposed to the whole program.
So, there is no security for the data.
 Examples of Procedural languages :
 BASIC
 C
 Pascal
 FORTRAN

 OBJECT ORIENTED PROGRAMMING (OOP):

Object-Oriented Programming System (OOPs) is a programming paradigm based on
the concept of ―objects‖ that contain data and methods, instead of just functions and
procedures.

 The primary purpose of object-oriented programming is to increase the
flexibility and maintainability of programs.
 Object oriented programming brings together data and its behavior (methods) in
to a single entity (object) which makes it easier to understand how a program
works.




 Features / advantages of Object Oriented Programming :-
1. It emphasis in own data rather than procedure.
2. It is based on the principles of inheritance, polymorphism, encapsulation and data
abstraction.


23IT1301 – Object Oriented Programming Unit - 1 III SEMESTER CSE

,Panimalar Engineering College 1. 3


3. Programs are divided into objects.
4. Data and the functions are wrapped into a single unit called class so that data is
hidden and is safe from accidental alternation.
5. Objects communicate with each other through functions.
6. New data and functions can be easily added whenever necessary.
7. Employs bottom-up approach in program design.

 Difference between POP and OOP:


Procedure Oriented Programming Object Oriented Programming

In POP, program is divided into small In OOP, program is divided into parts
Divided Into
parts called functions. called objects.
In POP, Importance is not given to In OOP, Importance is given to the data
Importance data but to functions as well as rather than procedures or functions
sequence of actions to be done. because it works as a real world.
Approach POP follows Top Down approach. OOP follows Bottom Up approach.
Access POP does not have any access OOP has access specifiers named
Specifiers specifier. Public, Private, Protected, etc.
In OOP, objects can move and
In POP, Data can move freely from
Data Moving communicate with each other through
function to function in the system.
member functions.
To add new data and function in POP OOP provides an easy way to add new
Expansion
is not so easy. data and function.
In POP, Most function uses Global In OOP, data cannot move easily from
data for sharing that can be accessed function to function, it can be kept
Data Access
freely from function to function in the public or private so we can control the
system. access of data.
POP does not have any proper way OOP provides Data Hiding so provides
Data Hiding
for hiding data so it is less secure. more security.
In OOP, overloading is possible in the
Overloading In POP, Overloading is not possible. form of Function Overloading and
Operator Overloading.
Examples of POP are: C, VB, Examples of OOP are: C++, JAVA,
Examples
FORTRAN, and Pascal. VB.NET, C#.NET.




 OBJECT ORIENTED PROGRAMMING CONCEPTS




23IT1301 – Object Oriented Programming Unit - 1 III SEMESTER CSE

, Panimalar Engineering College 1. 4


OOPs simplify the software development and maintenance by providing some concepts:

1. Class - Blue print of Object
2. Object - Instance of class
3. Encapsulation - Protecting our data
4. Polymorphism - Different behaviors at different instances
5. Abstraction - Hiding irrelevant data
6. Inheritance - An object acquiring the property of another object


1. Class:
A class is a collection of similar objects and it contains data and methods that operate
on that data. In other words ―Class is a blueprint or template for a set of objects
that share a common structure and a common behavior‖. It is a logical entity. It can't
be physical.
A class in Java can contain:
 fields
 methods
 constructors
 blocks
 nested class and interface


Syntax to declare a class:
class <class_name>
{
field;
method;
}




2. Object:
Any entity that has state and behavior is known as an object.

23IT1301 – Object Oriented Programming Unit - 1 III SEMESTER CSE

Connected book

Written for

Institution
Course

Document information

Uploaded on
September 17, 2024
Number of pages
84
Written in
2024/2025
Type
Class notes
Professor(s)
Anitha antony
Contains
All classes

Subjects

$5.69
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
monishrajip

Get to know the seller

Seller avatar
monishrajip Velammal Vidyashram
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions