Click here to Skip to main content
15,888,293 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# Pin
Chris Quinn22-May-14 5:02
Chris Quinn22-May-14 5:02 
GeneralRe: c# Pin
ZurdoDev22-May-14 5:06
professionalZurdoDev22-May-14 5:06 
AnswerRe: c# Pin
Dave Kreskowiak22-May-14 4:19
mveDave Kreskowiak22-May-14 4:19 
GeneralRe: c# Pin
Shady George22-May-14 8:11
Shady George22-May-14 8:11 
AnswerRe: c# Pin
ZurdoDev22-May-14 5:00
professionalZurdoDev22-May-14 5:00 
AnswerRe: c# Pin
V.22-May-14 6:21
professionalV.22-May-14 6:21 
Questionusing generic on method Pin
Gilbert Consellado22-May-14 0:40
professionalGilbert Consellado22-May-14 0:40 
AnswerRe: using generic on method Pin
Pete O'Hanlon22-May-14 0:50
mvePete O'Hanlon22-May-14 0:50 
As you have a method with an object, and a method that is accepting a generic, unless you actually specify object as your type, your code will resolve to the generic. You can think of this as being because the string is a more specialized type than an object, so while it is derived from object, it is NOT of type object. So, if you want to call the first method, you would do:
C#
object newString = "sample string";
s.add(newString);
Oh, one small point, your class won't compile because you haven't specified the return type of your add methods.
GeneralRe: using generic on method Pin
Gilbert Consellado22-May-14 0:58
professionalGilbert Consellado22-May-14 0:58 
GeneralRe: using generic on method Pin
Pete O'Hanlon22-May-14 1:01
mvePete O'Hanlon22-May-14 1:01 
GeneralRe: using generic on method Pin
Rob Philpott22-May-14 1:09
Rob Philpott22-May-14 1:09 
GeneralRe: using generic on method Pin
Gilbert Consellado22-May-14 1:20
professionalGilbert Consellado22-May-14 1:20 
GeneralRe: using generic on method Pin
Rob Philpott22-May-14 1:22
Rob Philpott22-May-14 1:22 
GeneralRe: using generic on method Pin
Richard Deeming22-May-14 2:00
mveRichard Deeming22-May-14 2:00 
GeneralRe: using generic on method Pin
Rob Philpott22-May-14 2:03
Rob Philpott22-May-14 2:03 
GeneralRe: using generic on method Pin
Pete O'Hanlon22-May-14 2:26
mvePete O'Hanlon22-May-14 2:26 
AnswerRe: using generic on method Pin
BobJanova22-May-14 1:58
BobJanova22-May-14 1:58 
QuestionRegarding .Net consultant Pin
Pramod Singh (C)21-May-14 19:06
professionalPramod Singh (C)21-May-14 19:06 
AnswerRe: Regarding .Net consultant Pin
Karen Mitchelle21-May-14 19:37
professionalKaren Mitchelle21-May-14 19:37 
AnswerRe: Regarding .Net consultant Pin
Bernhard Hiller21-May-14 21:42
Bernhard Hiller21-May-14 21:42 
AnswerRe: Regarding .Net consultant Pin
Richard MacCutchan21-May-14 21:56
mveRichard MacCutchan21-May-14 21:56 
AnswerRe: Regarding .Net consultant Pin
BobJanova22-May-14 2:01
BobJanova22-May-14 2:01 
AnswerRe: Regarding .Net consultant Pin
Dave Kreskowiak22-May-14 4:22
mveDave Kreskowiak22-May-14 4:22 
GeneralRe: Regarding .Net consultant Pin
Pete O'Hanlon22-May-14 6:47
mvePete O'Hanlon22-May-14 6:47 
GeneralRe: Regarding .Net consultant Pin
Dave Kreskowiak22-May-14 11:15
mveDave Kreskowiak22-May-14 11:15 

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.