answersLogoWhite

0


Best Answer

[Eating] A Pie:

Abstraction: grouping some data and behaviors into a programming unit with semantic similarity (not randomly), e.g, class, struct

Polymorphism: different object with the same name (same name of a method, variable, but in more than 1 form)

Inheritance: the most important characteristics of an OO language (Object base language would not have this one). It allows a derived class to inherit the data and behaviors from the base class(es), as if those data and behaviors are defined within.

Encapsulation: or information hiding. Object has data members that no one outside of the same class would know what type or shape they are. It also applied to the behaviors.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

The most important feature of OO Programming is "Inheritance"

Inheritance is an object oriented feature supported by Java wherein the features of one Java class can be inherited/made available in another class. This creates a parent child relationship between these 2 classes. Class Inheritance in java mechanism is used to build new classes from existing classes. The inheritance relationship is transitive: if class x extends class y, then a class z, which extends class x, will also inherit from class y. Object-oriented programming allows classes to inherit commonly used state and behavior from other classes.

Example:

public class Parent {

private String name = "Rocky";

public String getName(){

return this.name;

}

}

public class Child extends Parent {

public static void main(String[] args){

System.out.println("Name in Parent is: " + getName());

}

}

Here the getName() method is available only in the parent class but is directly used in the child class because the method is public and is directly accessible to the child class since it has extended the parent class.

Benefits of Inheritance:

One of the key benefits of inheritance is to minimise the amount of duplicate code in an application by sharing common code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be refactored to move the common code up to a mutual superclass. This also tends to result in a better organisation of code and smaller, simpler compilation units.

Inheritance can also make application code more flexible to change because classes that inherit from a common superclass can be used interchangeably. If the return type of a method is superclass

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

The ability to re-use the code you have written in other programs. Readability and organization are also important.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the main feature in object oriented programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Define structure oriented programming language?

A structure oriented language is one, which should the following structure as Documentation Section, Link section, Definition Section, Global declaration section and Functions(including Main functions) in an hierarchical order. This order cannot be interchanged, but structure oriented language like C can have these sections as optional. Correct me if am wrong, Neela.T


The main emphasis of procedure-oriented is on algorithms rather than on data?

the main emphasis of procedure oriented programming is on algorithms rather than on data


Object oriented design and procedural oriented design?

In object oriented programming main role plays objects and classes, in structure programming all programmes are represented as structures of block's, in procedure programming - that means high level programming languages, which are based on process description (sequence of processes) - all programmes are described like a set of subprogrammes or procedures.For more information you may search these articles:http:/en.wikipedia.org/wiki/Object-oriented_programminghttp://alarmingdevelopment.org/?p=9http:/en.wikipedia.org/wiki/Procedural_programming


What are the disadvantages of procedure oriented programming in c plus plus?

There are no any disadvantages of procedure oriented programming in C++. You can use it as well as object oriented programming, generic programming or any other paradigm. Just remember that this way you won't be using many helpful features of that language.


Why java know as true object oriented language?

Java is not a true object-oriented language.One of the requirements for such a title is that everything must be an object. Java contains non-object primitive values (such as int, float, boolean, etc.).

Related questions

Explain the main features or characters of object oriented programming?

adAD


What does an object message correspond to in non-Object oriented programming terms?

A call to a procedure from your main routine.


Define structure oriented programming language?

A structure oriented language is one, which should the following structure as Documentation Section, Link section, Definition Section, Global declaration section and Functions(including Main functions) in an hierarchical order. This order cannot be interchanged, but structure oriented language like C can have these sections as optional. Correct me if am wrong, Neela.T


What is the difference between Object-oriented software engineering and software engineering?

Object-oriented programming is just one possible methodology in the field of software engineering. It is a type of software engineering.See the related questions for a definition of object-oriented programming.


What is OOP language?

Before Object oriented programming the term which was used was “Structural Programming” where a programmer has to use the predefined data types, they cannot define their own data type. But when the term object oriented programming start in programming programmer become able to define its own data type according to their own use. Here a coder can define its own data types called classes and then create object from these classes. Coding in Object Oriented language Advantages of Object Oriented Programming One of the main advantages of OOP over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer simply can create a new object that inherits from existing objects many of its features . This makes object-oriented programs easier for programmer to modify.


The main emphasis of procedure-oriented is on algorithms rather than on data?

the main emphasis of procedure oriented programming is on algorithms rather than on data


Object oriented design and procedural oriented design?

In object oriented programming main role plays objects and classes, in structure programming all programmes are represented as structures of block's, in procedure programming - that means high level programming languages, which are based on process description (sequence of processes) - all programmes are described like a set of subprogrammes or procedures.For more information you may search these articles:http:/en.wikipedia.org/wiki/Object-oriented_programminghttp://alarmingdevelopment.org/?p=9http:/en.wikipedia.org/wiki/Procedural_programming


What are the disadvantages of procedure oriented programming in c plus plus?

There are no any disadvantages of procedure oriented programming in C++. You can use it as well as object oriented programming, generic programming or any other paradigm. Just remember that this way you won't be using many helpful features of that language.


Why java know as true object oriented language?

Java is not a true object-oriented language.One of the requirements for such a title is that everything must be an object. Java contains non-object primitive values (such as int, float, boolean, etc.).


What is the purpose of constructor in object oriented programming?

A constructor in a class is one of the first pieces of code to be executed when you instantiate a class. The purpose of constructors is to have code that initialize the class and prepare the variables that may be required by the class...


What is the difference between C programming and CPP programming?

C has no object oriented support. C++ is a superset of C that adds object-oriented support, but retains the concept of primitive variables. C# is a superset of C++, developed by Microsoft, that removes the concept of primitives, making it fully object-oriented but, unlike C and C++, is non-generic and is only useful for .NET programming. C# is not unlike Java, but Java is fully cross-platform and therefore has much wider support.


Why is C plus plus called an object oriented programming language?

Any language that supports class types, private and protected data, inheritance, polymorphism, function overriding, virtual methods is regarded as an object oriented programming language. However, while C++ supports OOP, it does not rely on it. You can mix C++ and C-style code (non-OOP) in the same program.