By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,777 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,777 IT Pros & Developers. It's quick & easy.

Instance with Inheritance

P: n/a
Can We create the instance of class with Inheritance like following :

Derivedclassname var = new Baseclassname

Jan 31 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Why not try it?

<ma*****@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
Can We create the instance of class with Inheritance like following :

Derivedclassname var = new Baseclassname

Jan 31 '07 #2

P: n/a
On Jan 31, 7:50 am, mask...@gmail.com wrote:
Can We create the instance of class with Inheritance like following :

Derivedclassname var = new Baseclassname
If you mean something like:

string x = new object();

then no, you can't - because the created object is *not* a string.

Jon

Jan 31 '07 #3

P: n/a
On Wed, 31 Jan 2007 08:02:45 -0000, "Paul Hadfield" <no****@noone.comwrote:
>Why not try it?

<ma*****@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegr oups.com...
>Can We create the instance of class with Inheritance like following :

Derivedclassname var = new Baseclassname
Paul,

Great answer!

I always wonder in these days of VS2k5 and the way one creates a project why
folks ask questions about things they could test in ten minutes instead of
waiting for some to answer their question. I mean no offense by saying this. I
just wonder why they don't make a test first.

It takes less than a minute to create a project. Maybe three to five minutes to
write the test code. Another minute to run the test. Another 30 seconds to
delete the project.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Jan 31 '07 #4

P: n/a
Otis Mukinfus <ph******************@phoney.comwrote in
news:r0********************************@4ax.com:
On Wed, 31 Jan 2007 08:02:45 -0000, "Paul Hadfield" <no****@noone.com>
wrote:
>>Why not try it?

<ma*****@gmail.comwrote in message
news:11**********************@q2g2000cwa.googleg roups.com...
>>Can We create the instance of class with Inheritance like following
:
Derivedclassname var = new Baseclassname
Great answer!

I always wonder in these days of VS2k5 and the way one creates a
project why folks ask questions about things they could test in ten
minutes instead of waiting for some to answer their question. I mean
no offense by saying this. I just wonder why they don't make a test
first.

It takes less than a minute to create a project. Maybe three to five
minutes to write the test code. Another minute to run the test.
Another 30 seconds to delete the project.
Quite, but it could be that the OP did indeed try this and wondered why it
didn't work. The precise phrasing of his question could itself be
questioned, but remember lots of posters do not have English as a first
language and posing accurate, succinct, and technically and grammatically
correct questions can pose a challenge.

An answer like Jon Skeet's is helpful.
Jan 31 '07 #5

P: n/a
On Wed, 31 Jan 2007 04:52:26 -0800, Peter K <xd****@hotmail.comwrote:
>Otis Mukinfus <ph******************@phoney.comwrote in
news:r0********************************@4ax.com :
>On Wed, 31 Jan 2007 08:02:45 -0000, "Paul Hadfield" <no****@noone.com>
wrote:
>>>Why not try it?

<ma*****@gmail.comwrote in message
news:11**********************@q2g2000cwa.google groups.com...
Can We create the instance of class with Inheritance like following
:
Derivedclassname var = new Baseclassname
Great answer!

I always wonder in these days of VS2k5 and the way one creates a
project why folks ask questions about things they could test in ten
minutes instead of waiting for some to answer their question. I mean
no offense by saying this. I just wonder why they don't make a test
first.

It takes less than a minute to create a project. Maybe three to five
minutes to write the test code. Another minute to run the test.
Another 30 seconds to delete the project.

Quite, but it could be that the OP did indeed try this and wondered why it
didn't work. The precise phrasing of his question could itself be
questioned, but remember lots of posters do not have English as a first
language and posing accurate, succinct, and technically and grammatically
correct questions can pose a challenge.

An answer like Jon Skeet's is helpful.
Thank you for the admonishment, Peter. My post was directed at Paul, not the
OP, but I certainly did forget to consider that a member of the
thought/political correctness police might read my post.

By the way, Peter, what information did you give the OP regarding the post? I
didn't see one. Maybe I missed it somewhere.

Good luck with your project,

Otis Mukinfus

http://www.otismukinfus.com
http://www.arltex.com
http://www.tomchilders.com
http://www.n5ge.com
Jan 31 '07 #6

P: n/a
"Otis Mukinfus" <ph******************@phoney.comwrote in message
news:oc********************************@4ax.com...
On Wed, 31 Jan 2007 04:52:26 -0800, Peter K <xd****@hotmail.comwrote:
>>Otis Mukinfus <ph******************@phoney.comwrote in
>>An answer like Jon Skeet's is helpful.

Thank you for the admonishment, Peter.
It wasn't really meant as an admonishment. It was really just in case you
(and Paul) hadn't thought of that possibility.
My post was directed at Paul, not the
OP, but I certainly did forget to consider that a member of the
thought/political correctness police might read my post.

Yes, well, there you go.
By the way, Peter, what information did you give the OP regarding the
post? I
didn't see one. Maybe I missed it somewhere.
No, I don't think you missed that. I didn't supply the OP with any
information regarding his question (much as neither you nor Paul did) - Jon
Skeet (as usual) provided a nice answer which was probably sufficient for
the OP's needs, and I am certainly not up to Jon's standards when it comes
to knowledge of c#.
Good luck with your project,
?

Good luck with your attitude.
Jan 31 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.