Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
What is object oriented programming?
I dont know a lot about computer, but I heard my friend talk about object oriented programming.
What is object oriented programming?
What are its major elements?
Is it an important concept in programming? Why so?
7 Answers
- 2 decades agoFavorite Answer
If you've never used an object-oriented language before, you need to understand the underlying concepts before beginning to write code. You need to know what an object is, what a class is, how objects and classes are related, and how objects communicate by using messages.
Object-oriented programming. Objects of the program interact by sending messages to each other.
What Is an Object? (in the Learning the Java Language trail)
An object is a software bundle of related variables and methods. Software objects are often used to model real-world objects you find in everyday life.
What Is a Message? (in the Learning the Java Language trail)
Software objects interact and communicate with each other using messages.
What Is a Class? (in the Learning the Java Language trail)
A class is a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind.
What Is Inheritance? (in the Learning the Java Language trail)
A class inherits state and behavior from its superclass. Inheritance provides a powerful and natural mechanism for organizing and structuring software programs.
What Is an Interface? (in the Learning the Java Language trail)
An interface is a contract in the form of a collection of method and constant declarations. When a class implements an interface, it promises to implement all of the methods declared in that interface.
How Do These Concepts Translate into Code? (in the Learning the Java Language trail)
This section looks at a small applet, and shows you the code that creates objects, implements classes, sends messages, establishes a superclass, and implements an interface.
for the importance part
Object-oriented programming is claimed to give more flexibility, easing changes to programs, and is widely popular in large-scale software engineering. Furthermore, proponents of OOP claim that OOP is easier to learn for those new to computer programming than previous approaches, and that the OOP approach is often simpler to develop and to maintain, lending itself to more direct analysis, coding, and understanding of complex situations and procedures than other programming methods. Translation from real-world phenomena/objects (and conversely) is eased because there is direct mapping from the real-world to the object-oriented program (generally a many-to-one). The converse mapping, from the object-oriented program back to the real-world, is by way of a one-to-many mapping, where each 'many' is seen to be a collection of well-defined subsets (or superset), which together compose a real-world object. The corresponding object defined in the program may be seen as representing some proper subset of the real-world object's features.
- 2 decades ago
Object oriented programming is basically a paradigm that makes it so that people, as understanding things in objects, i.e. table object, cat object, etc. etc. can program software. E.G. in C++, if I want to create some sort of object for an enemy, I can create a class such as:
TheEnemy, and I can add all the features that an enemy would have. Maybe TheEnemy has a certain number of lives, maybe TheEnemy has 23 bullets that he/she/it can shoot at ThePlayer, which has it's own set of variables and objects that define it. OOP is really useful, because otherwise, you would have to tell the computer in its own language what to do; with object oriented programming, you can tell the computer something that makes sense to you. It really is an invaluable aspect of programming.
- 2 decades ago
Object oriented programming is trying to model the world. Like the name is saying, object oriented creates objects that will interract together. Every objects, like in the real world, will have behaviour and characteristics.
By example, if you are writing a program for a bank, you gonna have objects like a person, payments, loan, etc.
A person gonna have characteristics like, age, sexe, address, etc. This person also gonna have behaviour : borrowing money, opening a bank account, etc
So when we program in object oriented, we create those objects, those characteristics and behaviour.
OO is very important nowadays and the most flexible programming languages are made in OO, like Java, C++, C# by example.
- Anonymous5 years ago
Java is an object oriented programming language yes.
- How do you think about the answers? You can sign in to vote the answer.
- Anonymous2 decades ago
i juts don't want to re-invent the wheel..
here's the link that'll help you