Objects are actually the instances of any particular class. They are the basic run-time entities. Generally, data are kept hidden within self-class (encapsulation) and can't be accessed from objects of other classes, but member functions are generally made public, so that they can communicate among themselves.
2007-02-21 23:39:11
·
answer #1
·
answered by Innocence Redefined 5
·
0⤊
0⤋
Object-Oriented Programming is a term that extends a lot further than java, and unfortunately, it's not very easy to give a detailed explanation in a short period of time.
To put it as briefly, (and not explaining much), Object Oriented Programming uses "objects" that interact together to perform tasks. Every "object" has a certain number of things that it can do, (called "methods"), and by using the right objects, a programmer can put a bunch of them together to accomplish a task.
Let me give you a silly example: Let's say that I want to "write a program" to wash a car... In order to wash a car, I need a number of objects...First, I need a "rag" object, that will wipe the car, then I need a "soap" object, to put on the rag, that will then go on the car, then I need a "water" object to wash and rinse with. If I were "programming" something like this, I'd first create an object for each of the things I needed...
(This is not in any programming language, it's just a silly example:)
create washcloth
washcloth can do: wiping, scrubbing
create water
water can do: washing, rinsing
create soap
soap can do: cleaning sanitizing
use rag to wipe and scrub
use soap to clean and sanitize
use water to wash and rinse
Okay, so to explain my silly example..in the "lines of code" above, I created each object, "rag, water, soap" in turn, by saying "create x" and then I gave each thing certain capabilities, by saying "x can do x". Once they had their capabilities, I used the capabilities of each "object" to accomplish my task, use x to x...
I know this seems silly, but if you can get your head around the basic concept, you'll be miles ahead of understanding the object oriented concept. Check out my sources for some much better articles on the web though.
2007-02-22 03:21:50
·
answer #2
·
answered by poeticjustice72182 3
·
1⤊
0⤋
Object Oriented is the programming for developing applications with full of objects. With these techniques the code is very simple to the programmer. Because of reusablity.
In java the object oriented technique is very simple. and also everything should be within class. so it is called pure object oriented programming. In java even developing Operating System also within objects. So that only java is powerful object oriented programming.
2007-02-22 03:05:50
·
answer #3
·
answered by sridhar b 2
·
0⤊
0⤋