A
asit
What is the difference between a class and an object ??
asit said:What is the difference between a class and an object ??
What is the difference between a class and an object ??
An object is an instance of a class. You can create
many objects of class Foo, for instance.
HTH
What is the difference between a class and an object ??
What is the difference between a class and an object ??
What is the difference between a class and an object ??
Ravishankar said:In languages supporting reflection, the class continues to exist in the
program as
an object.
What is the difference between a class and an object ??
In languages supporting reflection, the class continues to exist in the
program as
an object.
Isn't that just an instantiation of a class object (which itself has a
class definition)? Java.lang.Class is a class, and Class objects are
instantiated from it.
It doesn't make sense for a class to "exist" anywhere in a running
program, though you can create objects to represent it.
I'm getting dizzy.
I guess, that depends on what you mean by "exist". I could easily envision a
programming language where there is a keyword "type" that denotes a built
in type the values of which would be possible types. Basic operations on
types would include constructing objects, and hopefully some nice things
like obtaining information about available methods, overloaded operators,
the name of the type, etc. Thus, you could do
Michael said:On 2008-02-10 04:17:16 +1000, asit <[email protected]> said:
Tell me about dogs.
You'll probable come up with four legs, barks, has a tongue, can be
taught to play fetch... (Okay maybe not that exact list, but they are
very doggy attributes and behaviours).
Now how about a specific dog.
has four Long legs, barks Loudly, has a Rough tongue, has Been taught
to play fetch... (Okay doesn't have to be those descriptions, but that
describes one dog in terms of dogs in general (as above)).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.