PC Review


Reply
Thread Tools Rate Thread

class sealed Point cannot inerhit

 
 
Hex
Guest
Posts: n/a
 
      6th Dec 2011
hi all

it's my first message here, i have a problem with class Point
beacause this class is sealed. So i can not derive it

protected l class point3d : Point
{
point3d();

} ;

how can do that in other way ?
i want to use a new struct { int x,y,z } o a new class

thx in advance
claudio
 
Reply With Quote
 
 
 
 
Registered User
Guest
Posts: n/a
 
      6th Dec 2011
On Tue, 6 Dec 2011 04:14:06 -0800 (PST), Hex
<(E-Mail Removed)> wrote:

>hi all
>
>it's my first message here, i have a problem with class Point
>beacause this class is sealed. So i can not derive it
>
> protected l class point3d : Point
> {
> point3d();
>
> } ;
>
>how can do that in other way ?
>i want to use a new struct { int x,y,z } o a new class
>

The .NET 4 type Point3D may provide a suitable solution.
http://msdn.microsoft.com/en-us/libr...g.point3d.aspx

regards
A.G.

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      6th Dec 2011
On 12/6/2011 7:14 AM, Hex wrote:
> it's my first message here, i have a problem with class Point
> beacause this class is sealed. So i can not derive it
>
> protected l class point3d : Point
> {
> point3d();
>
> } ;
>
> how can do that in other way ?
> i want to use a new struct { int x,y,z } o a new class


Use composition instead of inheritance.

Arne


 
Reply With Quote
 
Hex
Guest
Posts: n/a
 
      8th Dec 2011
thank you all

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 AM.