Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
GeneralIntegrate WIndows Service and my application project Pin
ksanju100012-Jul-05 20:42
ksanju100012-Jul-05 20:42 
GeneralWindows Service in Windows XP Pin
ksanju100012-Jul-05 20:40
ksanju100012-Jul-05 20:40 
GeneralRe: Windows Service in Windows XP Pin
Dave Kreskowiak13-Jul-05 2:29
mveDave Kreskowiak13-Jul-05 2:29 
GeneralRe: Windows Service in Windows XP Pin
ksanju100013-Jul-05 4:14
ksanju100013-Jul-05 4:14 
GeneralRe: Windows Service in Windows XP Pin
Dave Kreskowiak13-Jul-05 5:06
mveDave Kreskowiak13-Jul-05 5:06 
GeneralProblem in creating objects of derived class Pin
tttyip12-Jul-05 20:28
tttyip12-Jul-05 20:28 
GeneralRe: Problem in creating objects of derived class Pin
S. Senthil Kumar12-Jul-05 21:15
S. Senthil Kumar12-Jul-05 21:15 
GeneralRe: Problem in creating objects of derived class Pin
tttyip13-Jul-05 16:11
tttyip13-Jul-05 16:11 
Thanks for your answer~~~
I have some more questions.
1) When a member in the base class (class A) is declared as private (say "private int x"), will the instance of the derived class (class B) has a that private member? Is that an inherited class always inherits all members of the base class but cannot access the private members? (For example, in this case, class B also has "private int x", but cannot access "x" )?

2) When a method in the base class (class A) is overridden by the derived class (class B), is that the overridden version of the method be always called?
For example,
class A
{
public virtual void Test()
{
Console.WriteLine("This is A");
}
}

class B : A
{
public virtual void Test()
{
Console.WriteLine("This is B");
}
}


static void Main()
{
B b = new B(); A a = b;
b.Test();
a.Test();
}

The above code sample is copied from a book, but I am confused.....
I know the statement "b.Test()" will cause the output "This is B"
but how about "a.Test()", as a is referenced to the object of type B, which version of the method will be called?
What is meant by "A a = b"?

Again, thanks a lot for your help!!

Regards,
Tommy
GeneralIIS Root Path location Pin
Sau Fan Lee12-Jul-05 17:28
Sau Fan Lee12-Jul-05 17:28 
GeneralRe: IIS Root Path location Pin
Expert Coming12-Jul-05 18:02
Expert Coming12-Jul-05 18:02 
GeneralMs Word Field Codes Pin
bootn12-Jul-05 17:05
bootn12-Jul-05 17:05 
GeneralRe: Ms Word Field Codes Pin
ekynox13-Jul-05 19:29
ekynox13-Jul-05 19:29 
GeneralSave as "TXT" File Pin
tatchung12-Jul-05 15:47
tatchung12-Jul-05 15:47 
GeneralRe: Save as "TXT" File Pin
Christian Graus12-Jul-05 17:28
protectorChristian Graus12-Jul-05 17:28 
GeneralRe: Save as "TXT" File Pin
tatchung12-Jul-05 17:36
tatchung12-Jul-05 17:36 
GeneralRe: Save as "TXT" File Pin
Christian Graus12-Jul-05 17:45
protectorChristian Graus12-Jul-05 17:45 
GeneralRe: Save as "TXT" File Pin
tatchung12-Jul-05 17:53
tatchung12-Jul-05 17:53 
GeneralRe: Save as "TXT" File Pin
Christian Graus12-Jul-05 17:55
protectorChristian Graus12-Jul-05 17:55 
GeneralRe: Save as "TXT" File Pin
tatchung12-Jul-05 18:03
tatchung12-Jul-05 18:03 
GeneralRe: Save as "TXT" File Pin
Christian Graus12-Jul-05 18:12
protectorChristian Graus12-Jul-05 18:12 
GeneralRe: Save as "TXT" File Pin
tatchung12-Jul-05 18:23
tatchung12-Jul-05 18:23 
GeneralRe: Save as "TXT" File Pin
Christian Graus12-Jul-05 18:27
protectorChristian Graus12-Jul-05 18:27 
GeneralRe: Save as "TXT" File Pin
tatchung12-Jul-05 18:34
tatchung12-Jul-05 18:34 
GeneralRe: Save as "TXT" File Pin
Christian Graus12-Jul-05 18:43
protectorChristian Graus12-Jul-05 18:43 
GeneralRe: Save as "TXT" File Pin
tatchung12-Jul-05 18:50
tatchung12-Jul-05 18:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.