Docsity

Object-Oriented Programming (OOP) Concepts in Java: A Beginner's Guide, Lecture notes of Computer science

Toggle sidebar
bg1
Object Oriented Programming
(OOPs) Concept in Java
The object-oriented is built on the foundation laid by structured programming concepts. The
fundamental change in OOP is that a program is designed around the data being operated
upon rather than the operations themselves. Refers to languages that use objects in
programming, they use objects as a primary source to implement what is to happen in the
code.
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Object-Oriented Programming (OOP) Concepts in Java: A Beginner's Guide and more Lecture notes Computer science in PDF only on Docsity!

Object Oriented Programming

(OOPs) Concept in Java

The object-oriented is built on the foundation laid by structured programming concepts. The fundamental change in OOP is that a program is designed around the data being operated upon rather than the operations themselves. Refers to languages that use objects in programming, they use objects as a primary source to implement what is to happen in the code.

List of the core Oops Concepts

1. Object

2. Class

3. Inheritance

4. Polymorphism

5. Abstraction

6. Encapsulation

Exercise

Get one whole sheet of paper. Create a CLASS of STUDENTS ( your classmates)

with five OBJECT (students’ names). Identify the state and behavior of the

students.

State: NAME, AGE, SEX, ADDRESS

Behavior: SING, DANCE, DRAW & SWIM

Create a Class

To create a class, use the keyword class:

Main.java

Create a class named "Main" with a variable y:

Create an Object

To create an object of Main, specify the class name, followed by the object name, and use the keyword new:

Multiple Objects

You can create multiple objects of one class:

Create two objects of Main: