Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
Questionlist of each layers for shapes Pin
chongkj8-Mar-07 4:01
chongkj8-Mar-07 4:01 
AnswerRe: list of each layers for shapes Pin
Edmundisme8-Mar-07 5:16
Edmundisme8-Mar-07 5:16 
QuestionCreating Clinet/Server protocol... Pin
yarns8-Mar-07 3:17
yarns8-Mar-07 3:17 
AnswerRe: Creating Clinet/Server protocol... Pin
Colin Angus Mackay8-Mar-07 3:24
Colin Angus Mackay8-Mar-07 3:24 
AnswerRe: Creating Clinet/Server protocol... Pin
Pete O'Hanlon8-Mar-07 3:25
mvePete O'Hanlon8-Mar-07 3:25 
GeneralRe: Creating Clinet/Server protocol... Pin
yarns8-Mar-07 3:43
yarns8-Mar-07 3:43 
AnswerUse Web Services Pin
Ennis Ray Lynch, Jr.8-Mar-07 4:00
Ennis Ray Lynch, Jr.8-Mar-07 4:00 
QuestionOOPs question: whats the difference between these ways of accessing methods !!! Pin
Arindam Tewary8-Mar-07 3:05
professionalArindam Tewary8-Mar-07 3:05 
class P
{
        public void foo1()
        {
            Console.WriteLine("Inside class AA method foo1");
        }
        public void foo2()
        {
            Console.WriteLine("Inside class AA method foo2");
        }
}

I can use the methods of this class "P" two way !!!!

1. I can inherit in a derived class like this way
class Q:P
{
        
}

Q q = new Q();
q.foo1();
q.foo2();


2. I can take an instance of class P in some class and I can expose the object of class P using some property ....

class R
{
    P aa = new P();
    public P Prop
    {
        get
        {
            return this.aa;
        }
    }
}

R r = new R();
r.Prop.foo1();
r.Prop.foo2();


My question is what is the pros and cons of this kind of method accessing technique!!!

When to use which one ?? Is there any difference between these two ???


Thanks,
Arindam D Tewary

AnswerRe: OOPs question: whats the difference between these ways of accessing methods !!! Pin
N a v a n e e t h8-Mar-07 3:12
N a v a n e e t h8-Mar-07 3:12 
GeneralRe: OOPs question: whats the difference between these ways of accessing methods !!! Pin
Arindam Tewary8-Mar-07 18:00
professionalArindam Tewary8-Mar-07 18:00 
AnswerRe: OOPs question: whats the difference between these ways of accessing methods !!! Pin
Pete O'Hanlon8-Mar-07 3:23
mvePete O'Hanlon8-Mar-07 3:23 
GeneralRe: OOPs question: whats the difference between these ways of accessing methods !!! Pin
Arindam Tewary8-Mar-07 17:53
professionalArindam Tewary8-Mar-07 17:53 
AnswerRe: OOPs question: whats the difference between these ways of accessing methods !!! Pin
Guffa8-Mar-07 3:56
Guffa8-Mar-07 3:56 
GeneralRe: OOPs question: whats the difference between these ways of accessing methods !!! Pin
Arindam Tewary8-Mar-07 17:56
professionalArindam Tewary8-Mar-07 17:56 
QuestionDateTime format Problem Pin
sks838-Mar-07 2:52
sks838-Mar-07 2:52 
AnswerRe: DateTime format Problem Pin
Colin Angus Mackay8-Mar-07 3:21
Colin Angus Mackay8-Mar-07 3:21 
Questionflash animations on forms [modified] Pin
nadapublicidad8-Mar-07 2:29
nadapublicidad8-Mar-07 2:29 
AnswerRe: flash animations on forms Pin
VirtualVoid.NET8-Mar-07 2:36
VirtualVoid.NET8-Mar-07 2:36 
AnswerRe: flash animations on forms Pin
Russell Jones8-Mar-07 4:19
Russell Jones8-Mar-07 4:19 
QuestionExcel Read/Write Pin
dotnethunk8-Mar-07 2:21
dotnethunk8-Mar-07 2:21 
AnswerRe: Excel Read/Write Pin
N a v a n e e t h8-Mar-07 2:23
N a v a n e e t h8-Mar-07 2:23 
GeneralRe: Excel Read/Write Pin
dotnethunk8-Mar-07 2:39
dotnethunk8-Mar-07 2:39 
QuestionC# interfaces doesn't contain data members Pin
DGtech8-Mar-07 2:17
DGtech8-Mar-07 2:17 
AnswerRe: C# interfaces doesn't contain data members Pin
Pete O'Hanlon8-Mar-07 2:22
mvePete O'Hanlon8-Mar-07 2:22 
AnswerRe: C# interfaces doesn't contain data members Pin
Colin Angus Mackay8-Mar-07 2:22
Colin Angus Mackay8-Mar-07 2:22 

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.