Feb 05

.Net Properties Question asked and my Answer

C# | My Inbox 28 Comments »

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Hi,

Can any body guide me whats the exact use or *Properties* (get and set) in
C#.

I know how to declare but not sure how to use it. Please guide.

Thanks,



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags:

Feb 05

A Question from a reader and my Answer

C# | Design Patterns | My Inbox 4 Comments »

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Greetings!

I have a hierarchy of classes, with an abstract class that defines the
method Read() at the top of it. Each class in the hierarchy has a
Read() method, and I need to be able to call Read() from the highest
possible level of the hierarchy and get the correct Read() function.

Public class AbstractClass 
{
abstract void Read();
}

Public class A : AbstractClass
{
public override void Read();
}

Public class B: A
{
public override void Read();
}

The compiler complains that A has no overridable function named Read().
Is it not possible to do this?

Thank you very much.

RobR


[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags: