 |
| C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 26th, 2008, 05:37 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Difference between Instance and Object in #
Halo,
Q. No- 1 What is the difference between Instance and Object in C#
and
Q. No- 2
class A
{
public virtual void get()
{
Console.WriteLine("Hello");
}
}
class B:A
{
public override void get()
{
Console.WriteLine("Fine");
}
}
Ist Method
A e = new B();
e.get();
IInd Method
B e = new B();
e.get();
Difference between in Ist Method and IInd Method of intializing the object of the the Class A
|
|

August 26th, 2008, 05:41 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
|
|

August 26th, 2008, 05:49 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Te-he :)
/- Sam Judson : Wrox Technical Editor -/
|
|

August 26th, 2008, 07:15 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm not getting the right answer. If you can suggest me the way tht's very better.....................
|
|

August 26th, 2008, 07:26 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Well, what ever course you are doing MUST have covered object instantiation, inheritance and the like..
And even if it hasn't, type the code, what does the code tell you?
Rob
http://cantgrokwontgrok.blogspot.com
|
|

August 26th, 2008, 08:15 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<b>(Differnce between Instance and Object)</b> I knw this is very basic question. Plz visit this link http://www.codeproject.com/script/Fo...49&msg=2694434<b>.NET- India</b> is my name(in the community) then u can understand why i m so confused it has taken a long discussion but still not very clear and understandable......
|
|

August 26th, 2008, 08:26 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
You don't need to ponder this one very long - all you need to do is type the code up and compile it - it will give you the answer in front of you.
/- Sam Judson : Wrox Technical Editor -/
|
|

August 26th, 2008, 08:42 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes i got my second question's answer by implementing a simple question
the question was Diff between
A e=new B();
e.get();
B e=new B();
e.get();
But still a bit confused about "diff between instance and object"
|
|

August 26th, 2008, 08:50 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
So what are you saying? You don't know what the words "object" and "instance" mean?!
Rob
http://cantgrokwontgrok.blogspot.com
|
|

August 26th, 2008, 09:22 AM
|
|
Authorized User
|
|
Join Date: Nov 2006
Posts: 93
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I don't like these kinds of ambiguities, especially in software development. In object oriented programming, an object is an instance of a class period! The object doesn't exist until the class is instantiated and memory has been allocated (part of the instantiation process).
What you don't know can hurt you!
|
|
 |