Click here to Skip to main content
15,893,487 members
Home / Discussions / C#
   

C#

 
AnswerRe: Unique value generation? Pin
GregD29-Apr-07 1:59
GregD29-Apr-07 1:59 
QuestionRTB nuances Pin
Mike Hankey27-Apr-07 1:09
mveMike Hankey27-Apr-07 1:09 
AnswerRe: RTB nuances Pin
Arun.Immanuel27-Apr-07 1:33
Arun.Immanuel27-Apr-07 1:33 
GeneralRe: RTB nuances Pin
Mike Hankey27-Apr-07 7:06
mveMike Hankey27-Apr-07 7:06 
Questionformula for a crystal report Pin
rkherath27-Apr-07 0:44
rkherath27-Apr-07 0:44 
GeneralUgly Mess with Data Source Pin
Brady Kelly27-Apr-07 0:17
Brady Kelly27-Apr-07 0:17 
QuestionMacro to insert File header and function header in C# Pin
jayart27-Apr-07 0:09
jayart27-Apr-07 0:09 
AnswerRe: Macro to insert File header and function header in C# Pin
Christian Graus27-Apr-07 0:36
protectorChristian Graus27-Apr-07 0:36 
GeneralRe: Macro to insert File header and function header in C# Pin
jayart27-Apr-07 2:27
jayart27-Apr-07 2:27 
GeneralRe: Macro to insert File header and function header in C# Pin
Kevin McFarlane27-Apr-07 3:12
Kevin McFarlane27-Apr-07 3:12 
QuestionPlzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
EEmaan27-Apr-07 0:09
EEmaan27-Apr-07 0:09 
AnswerRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
Christian Graus27-Apr-07 0:40
protectorChristian Graus27-Apr-07 0:40 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
EEmaan27-Apr-07 0:48
EEmaan27-Apr-07 0:48 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
Arun.Immanuel27-Apr-07 1:22
Arun.Immanuel27-Apr-07 1:22 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
Christian Graus27-Apr-07 1:30
protectorChristian Graus27-Apr-07 1:30 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
Christian Graus27-Apr-07 1:23
protectorChristian Graus27-Apr-07 1:23 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
EEmaan27-Apr-07 1:39
EEmaan27-Apr-07 1:39 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
Christian Graus27-Apr-07 1:50
protectorChristian Graus27-Apr-07 1:50 
GeneralRe: Plzzzzzzzzzzzzzzzzzzzzzzzzzz Help in form closing Pin
ChandraRam27-Apr-07 2:57
ChandraRam27-Apr-07 2:57 
Questionuse of assigning the object impelementing a interface to an interface [modified] Pin
sishya26-Apr-07 23:45
sishya26-Apr-07 23:45 
Hi guys ,
I came across a piece of code similar to the below one.

public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
ad test = new ad();
Ia id5 = test.testobj();
id5.display()
}
}

public interface Ia
{
void display();
}
public class b : Ia
{
public void display()
{
MessageBox.Show("do it man");
}
}

public class ad
{
public Ia testobj()
{
b gh = new b();
return gh;

}
}

My question is why should we typecast object gh to interface Ia in testobj() function as the interface object when we can directly use the object of class b to call display function.

Thans in advance,
sishya


-- modified at 5:54 Friday 27th April, 2007
AnswerRe: use of assigning the object impelementing a interface to an interface Pin
Christian Graus27-Apr-07 0:02
protectorChristian Graus27-Apr-07 0:02 
AnswerRe: use of assigning the object impelementing a interface to an interface Pin
GregD29-Apr-07 2:08
GregD29-Apr-07 2:08 
QuestionWebbased SQL Query Analyzer? Pin
Succodimele26-Apr-07 23:37
Succodimele26-Apr-07 23:37 
AnswerRe: Webbased SQL Query Analyzer? Pin
Christian Graus26-Apr-07 23:47
protectorChristian Graus26-Apr-07 23:47 
GeneralRe: Webbased SQL Query Analyzer? Pin
Succodimele26-Apr-07 23:56
Succodimele26-Apr-07 23:56 

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.