Can We create the instance of class with Inheritance like following :
Derivedclassname var = new Baseclassname 6 1378
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
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
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
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.
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
"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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike Meng |
last post by:
hi all,
I'm a newbie Python programmer with a C++ brain inside. I have a
lightweight framework in which I design a base class and expect user to
extend. In other part of the framework, I heavily...
|
by: Will |
last post by:
Is it possible to have private instance members in a javascript class?
function myObject() {
var private = 1;
this.getPrivate = function() {
return private;
}
this.incrementPrivate =...
|
by: Martin |
last post by:
I'd like to be able to get the name of an object instance from within
a call to a method of that same object. Is this at all possible?
The example below works by passing in the name of the object...
|
by: Baski |
last post by:
Base class:
class AssetBase
{
string _clli;
public string CLLI
{
get
|
by: John M. Gabriele |
last post by:
The following short program fails:
----------------------- code ------------------------
#!/usr/bin/python
class Parent( object ):
def __init__( self ):
self.x = 9
print "Inside...
|
by: D Witherspoon |
last post by:
What is happening is that I have a class (ClassA) that inherits a class
(ClassB) which inherits System.Net.Mail.MailMessage
Project 1 references Project 2,
Project 2 references Project 3.
...
|
by: bonk |
last post by:
When I have an instance of an object wich is of type System.Type, how
can I find out if it directly or indirecly derives from another type?
myTypeInstance == typeof(AnotherType)
only seems to...
|
by: glomde |
last post by:
Hi I wonder if you can set what subclass a class should
have at instance creation.
The problem is that I have something like:
class CoreLang():
def AssignVar(self, var, value):
pass
class...
|
by: =?Utf-8?B?QmV0aA==?= |
last post by:
Hello.
I'm trying to find another way to share an instance of an object with other
classes.
I started by passing the instance to the other class's constructor, like this:
Friend Class...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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,...
|
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...
| |