473,417 Members | 1,628 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,417 software developers and data experts.

object & instance

184 100+
Hi all,
What is the difference between object & Instance in Java??
Thanks in Advance

-Hamsa
Sep 5 '07 #1
11 2030
r035198x
13,262 8TB
Hi all,
What is the difference between object & Instance in Java??
Thanks in Advance

-Hamsa
Some believe that an object is a specific/particular form of an instance.
I believe that an object is an instance of a class.
What do you believe?
Sep 5 '07 #2
gaya3
184 100+
Some believe that an object is a specific/particular form of an instance.
I believe that an object is an instance of a class.
What do you believe?
hi,
only half i got from ur explanation.. bit confusing...
it ll be useful if u explain with any example please..

-Hamsa
Sep 5 '07 #3
r035198x
13,262 8TB
hi,
only half i got from ur explanation.. bit confusing...
it ll be useful if u explain with any example please..

-Hamsa
Which part is confusing you?
Sep 5 '07 #4
dmjpro
2,476 2GB
Hi all,
What is the difference between object & Instance in Java??
Thanks in Advance

-Hamsa
What you have, tell me first.
Explain with some examples what concept you have already.

Kind regards,
Dmjpro.
Sep 5 '07 #5
JosAH
11,448 Expert 8TB
To me 'object' and 'instance' are synonyms; 'instance' sounds a bit spiffier though.
The class is the blueprint and the object/instance is an instantiation (sic) of the blueprint.

kind regards,

Jos
Sep 5 '07 #6
praveen2gupta
201 100+
Hi all,
What is the difference between object & Instance in Java??
Thanks in Advance

-Hamsa
Hi
as I understood so far Objects are derived from class and Instance is the process/mechanism which creates an object. Tell me where do you have confussion.
Sep 5 '07 #7
JosAH
11,448 Expert 8TB
Hi
as I understood so far Objects are derived from class and Instance is the process/mechanism which creates an object. Tell me where do you have confussion.
You're talking about "instantiation" here (the process of creating an instance of
a class, the instance is synonymous to an "object").

kind regards,

Jos
Sep 5 '07 #8
kreagan
153 100+
Hi all,
What is the difference between object & Instance in Java??
Thanks in Advance

-Hamsa
An instance is an object with state. All pencils have erasers and lead. But one pencil I hold in my hand, this instance of this pencil has a pink eraser and sharp point. My brother's pencil has a blue eraser with ear wax on it (yes, pencils can be used as que tips), bite marks, and a dull point. They are both objects of the same class but different instances.

I hope that helps.
Sep 5 '07 #9
JosAH
11,448 Expert 8TB
An instance is an object with state.
Huh? You're confusing terms here. An object can have state but it needn't; it is
still an instance of some class.

kind regards,

Jos
Sep 5 '07 #10
kreagan
153 100+
An object can have state but it needn't; it is
still an instance of some class.

kind regards,

Jos
An object always have a state of some sort. I might be using the term more abstractly than I should. I see it as something that seperates one instance from another instance. Even a difference in memory address could be considered as a different state, in my mind. Furthermore, all objects have an initialized state even if they don't have instance variables.
Sep 5 '07 #11
JosAH
11,448 Expert 8TB
An object always have a state of some sort. I might be using the term more abstractly than I should. I see it as something that seperates one instance from another instance. Even a difference in memory address could be considered as a different state, in my mind. Furthermore, all objects have an initialized state even if they don't have instance variables.
I was responding to this:

An instance is an object with state.
That implies that an object needn't have state while an instance has state. IMHO
an ojbect is an instance; both are a 'realization' of a class. I'm running out of
synonyms here.

kind regards,

Jos
Sep 5 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Patrick | last post by:
I want to achieve the following behaviour but I am having trouble getting there...bare with me im knew to c++ , so its probably rather trivial! To have a class ClassA, and composed within this...
1
by: Jean Stax | last post by:
Hi ! A couple of pretty basic questions: Value types: As far as I understand, when I create value type without "new" syntax the object is considered as unutilized. Consequently, I have to...
10
by: yop | last post by:
All When I try to get the text from my listbox I am get an error which is listed below. Any ideas? Thanks Object reference not set to an instance of an object.
2
by: Chris Murphy via DotNetMonster.com | last post by:
Hey guys, I've been hitting a brick wall with a problem I've come accross in developing an application. Background: The application uses one primary class that I'm trying to implement with the...
0
by: Dica | last post by:
Hi all I've got a java microEdition client trying to make soap requests to my .Net service. i keep getting "Server was unable to process request..." err msg when attempting to make the request....
4
by: AMP | last post by:
Hello, I want to use a ready made class (ie a System.Drawing .Pen) and make it available to my entire application, but I'm getting stupid. How do I do this? Or point me in the right direction....
4
by: gg9h0st | last post by:
i worte a simple code below. ------------------------------------------------------------------------------------ #include "stdafx.h" class Object { public: int a;
32
by: Joe | last post by:
I am just starting to use Object Oriented PHP coding, and I am seeing quite often the following (this example taken from a wiki): $wakka =& new Wakka($wakkaConfig); What exactly is the =&, and...
0
by: dolittle | last post by:
Hi, I'm embedding a last.fm flash widget. I want to be able to remove it from the page using javascript. I've tried to delete the html element that contains the code but it keeps playing in...
1
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
I'm running VS2008 & attempting to solve a problem I've encountered while developing some software for our business. Here's the basic idea...I've created a class that represents a file (with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.