Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

God is Great. Whatever, Study notes of Object Oriented Programming

God is Great. Ujjain is the city of Gods

Typology: Study notes

2021/2022

Uploaded on 02/23/2023

rimzaharsh
rimzaharsh 🇮🇳

1 document

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
It is a header file which contains the
prototype of endl function and a namespace
std which contains declaration of cin and
cout objects.
A class is a user defined data type which is
used to make an own data type. A class
keyword is used to declare a class. A class
contains two things i.e. properties and
methods. The object is created by the class
and the size of the class is determined by the
properties present in the class.
A members of a class in specified by three
access specifiers i.e. private, public and
protected.
Encapsulation is a technique to hide the
internal features of an object. The
encapsulation can only be done by private
access specifier which is only applicable for
class. It doesn't let those properties or
methods which are declared or defined under
it, to be disturbed by any other function
defined outside of that class. The advantage
of encapsulation is that the object stays in a
valid state.
Television is the best example of
encapsulation because if the manufacturer
doesn’t cover the back side of the television
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download God is Great. Whatever and more Study notes Object Oriented Programming in PDF only on Docsity!

It is a header file which contains the prototype of endl function and a namespace std which contains declaration of cin and cout objects. A class is a user defined data type which is used to make an own data type. A class keyword is used to declare a class. A class contains two things i.e. properties and methods. The object is created by the class and the size of the class is determined by the properties present in the class. A members of a class in specified by three access specifiers i.e. private, public and protected. Encapsulation is a technique to hide the internal features of an object. The encapsulation can only be done by private access specifier which is only applicable for class. It doesn't let those properties or methods which are declared or defined under it, to be disturbed by any other function defined outside of that class. The advantage of encapsulation is that the object stays in a valid state. Television is the best example of encapsulation because if the manufacturer doesn’t cover the back side of the television

by a back panel then anyone can disturb it’s internal features and the object i.e. television stays in invalid state. Therefore, the back side of television is being encapsulated by a back panel. So, that the object stays in valid state. Polymorphism is defined by three statements they are:-

  1. Existence of a process in many forms.
  2. Which process get executed should depend upon the input.
  3. All of the forms should reside under a single unit. If a process satisfies these three statements then polymorphism can be established. We can understand polymorphism by the scenario checking process of a company which is done by a watchman of the company. Since, we know that there are many types of employees and workers in a company. So, the process of checking is different for employees and workers. So in this scenario :--
  4. The checking process has many forms.

So, that’s why the container doesn’t get the properties of content but it get it's name. There are two types of container :-

  1. Aggregate Container.
  2. Non Aggregate Container. Aggregate Container are those type of container which can contain only a particular thing, and the thing which it contains is the reason that we call it a container. For Example :- A pen is called an aggregate container if it contains ink in it i.e. the container is renowned by content. Non Aggregate Container are those type of container which doesn’t depend upon content or which can contain anything into it with some limitations also. For Example :- A briefcase is a type of non aggregate container because it can contain number of things into it. But the briefcase also has some limitations i.e. it cannot contain water into it. Method Overriding means to redeclare a method of base class into derived class. Access Specifier which decides the access of properties and methods of a class in a function.

They are of three types

  1. Public
  2. Private
  3. Protected Public: The properties and methods of a class defined under this access specifier can be used by any object of a particular class declared inside a function. Private: The properties and methods of a class defined under this access specifier can not be directly used by any object of a particular class declared inside any function. Protected: In this access specifier the properties and methods declared under this in any class can never be used by any object declared inside any function. But private and protected access specifier can be used by any friend function declared inside a class. Static property is that property who can be used by any object but the last assigned value of that property is same for all objects and it can be used by any function.

System.out.printf(“%d is alloted to %s
n”,rollNumber,vName); raf.close(); return; } } System.out.println(“Enter Name :”); vName=raf.readine(); raf.writeBytes(vName); raf writeBytes(“\n”); raf.writeBytes(valuTo(vRollNumber)); raf.writeBytes(“\n”); raf.close(); System.out.println(“Student Added”); } Public void editStudent() {} Public void deleteStudent() {} Public void searchStudent()

Public void displayListOfStudents() {} } Class UI { Public static void main{String gg[]) { InputStreamReader isr=new InputStreamReader(Syatem.in); BufferedReader br=new BufferedReader(isr); Int ch; While(1) { System.out.println(“1. Add Student”); System.out.println(“2. Edit Student”); System.out.println(“3. Delete Student”); System.out.println(“4. Search Student”); System.out.println(“5. Display list of Student”); System.out.println(“6. Exit”); System.out.println(“Enter your choice : “);