100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Java Programming notes $5.19   Add to cart

Class notes

Java Programming notes

 4 views  0 purchase
  • Course
  • Institution
  • Book

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.

Preview 4 out of 84  pages

  • September 17, 2024
  • 84
  • 2024/2025
  • Class notes
  • Anitha antony
  • All classes
avatar-seller
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller monishrajip. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.19. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76710 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.19
  • (0)
  Add to cart