What are the OOPS concepts?

Answer Posted / swetcha

1) Encapsulation: It is the mechanism that binds together
code and data in manipulates, and keeps both safe from
outside interference and misuse. In short it isolates a
particular code and data from all other codes and data. A
well-defined interface controls the access to that
particular code and data.
2) Inheritance: It is the process by which one object
acquires the properties of another object. This supports
the hierarchical classification. Without the use of
hierarchies, each object would need to define all its
characteristics explicitly. However, by use of inheritance,
an object need only define those qualities that make it
unique within its class. It can inherit its general
attributes from its parent. A new sub-class inherits all of
the attributes of all of its ancestors.
3) Polymorphism: It is a feature that allows one interface
to be used for general class of actions. The specific
action is determined by the exact nature of the situation.
In general polymorphism means "one interface, multiple
methods", This means that it is possible to design a
generic interface to a group of related activities. This
helps reduce complexity by allowing the same interface to
be used to specify a general class of action. It is the
compiler's job to select the specific action (that is,
method) as it applies to each situation

Is This Answer Correct ?    1138 Yes 208 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1636


Write a program to reverse a string using recursive function?

1788


What is pointer in oop?

533


what is the drawback of classical methods in oops?

2916


What is oops in programming?

562






What is multilevel inheritance in oop?

553


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

1789


What is protected in oop?

602


What is the highest level of cohesion?

575


What is polymorphism what are the different types of polymorphism?

559


Objective The objective of this problem is to test the understanding of Object-Oriented Programming (OOP) concepts, in particular, on encapsulation. Problem Description Create a program for managing customer’s bank accounts. A bank customer can do the following operations: 1. Create a new bank account with an initial balance. 2. Deposit money into his/her account. 3. Withdraw money from his/her account. For this operation, you need to output “Transaction successful” if the intended amount of money can be withdrawn, otherwise output “Transaction unsuccessful” and no money will be withdrawn from his/her account. Input The input contains several operations and is terminated by “0”. The operations will be “Create name amount”, “Deposit name amount”, or “Withdraw name amount”, where name is the customer’s name and amount is an integer indicating the amount of money. There will be at most 100 bank accounts and they are all created on the first month when the bank is opening. You may assume that all account holders have unique names and the names consist of only a single word. Output The output contains the transaction result of withdrawal operations and the final balance of all customers after some withdrawal and deposit operations (same order as the input). Sample Input Create Billy 2500 Create Charlie 1000 Create John 100 Withdraw Charlie 500 Deposit John 899 Withdraw Charlie 1000 0

1700


What does no cap mean?

590


what is graphics

2009


What is the advantage of oop over procedural language?

623


Can we create object of interface?

601