Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-15 Thread Akter Suriya
Thanks a lot shakti On Tue, Jun 15, 2010 at 7:31 PM, Shakti Singh Tanwar < shaktisingh.tan...@gmail.com> wrote: > well the only valid point is that you can't call an abstract method...n if > it's override in child class means it must be either virtual or abstract in > base class > > I wrot

Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-15 Thread Shakti Singh Tanwar
well the only valid point is that you can't call an abstract method...n if it's override in child class means it must be either virtual or abstract in base class I wrote a 4 article series on dotnetspider long time back..kindly go through them to left you shocked :) Part-1 -- http://www.dotn

Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-15 Thread Akter Suriya
thanks a lot shakti, Any other point (if any) for support of your statement. (though i got the clarification by your statement). Thanks, Suriya On Mon, Jun 14, 2010 at 6:58 PM, Shakti Singh Tanwar < shaktisingh.tan...@gmail.com> wrote: > very simple > In class B you are calling base.method()

Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-14 Thread Raghupathi Kamuni
Thumb Rules: 1) You can never create an object of an abstract class 2) You can never call a method of an abstract class On Mon, Jun 14, 2010 at 6:05 PM, Akter Suriya wrote: > Yes Raghupathi, > > That you can check when you have computer in hand. What if this question is > asked in interview (wit

Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-14 Thread Shakti Singh Tanwar
very simple In class B you are calling base.method() which is only possible if the method is virtual not abstract On 6/14/10, Akter Suriya wrote: > > One of my friend asked me this question. > > class A > { > XXX method1() > .. > } > > > class B : A > { > override method1 () > { > base.m

Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-14 Thread Akter Suriya
Yes Raghupathi, That you can check when you have computer in hand. What if this question is asked in interview (without machine)? Thanks, Suriya On Mon, Jun 14, 2010 at 5:51 PM, Raghupathi Kamuni wrote: > *If keyword is abstract, it would never compile.* > Error message will be "Cannot call an

Re: [DotNetDevelopment] Virtual and abstract method question

2010-06-14 Thread Raghupathi Kamuni
*If keyword is abstract, it would never compile.* Error message will be "Cannot call an abstract base member: 'A.method1()'" *Code for Abstract method* = using System; abstract class A { public abstract void method1(); } class B:A { public override void method1() {

[DotNetDevelopment] Virtual and abstract method question

2010-06-14 Thread Akter Suriya
One of my friend asked me this question. class A { XXX method1() .. } class B : A { override method1 () { base.method1(); } } He says, how can we identify, XXX (written in front of method1 in class A) is virtual or abstract. Can anybody help me. Thanks. -- Suriya