Note that there are some explanatory texts on larger screens.

plurals
  1. POC#.Net Interview create an object from a class
    primarykey
    data
    text
    <p>Having just finished the first part of my schooling I'm looking for work. I went to an interview for a C#.net developer. During the interview I was asked to create a class with two properties. Then in a asp.net form create an object from that class. So I created a class with a constructor that took two strings, setting the properties of the object. In the asp.net page I added two text boxes and a button. In the button's click method I put in the line <code>Class whatever = new Class(textbox1.text, textbox2.text)</code> </p> <p>So after I finish I look at the gentlemen that are interviewing me and wonder why they are looking at me like I'm crazy. So I ask, "You don't think that will work?" They replied, "Run it and we'll see". Ok, so I ran the program, entered some text into the text boxes and clicked the button. Guess what, nothing happened lol. At which point I said, "If you want, I can output the object to some labels or something if you want." They said as they were looking at me like I've done something wrong, "No, just put a break point on this line and run the program again." So we run the program again, the break point shows that the object was created with the text. Then I hear "Hmmm, that worked." At which point I tuned to them and said, "Are you guys messing with me or did you really think that that wouldn't work?" They replied that what I was was just a really old way to create an object. Are there other ways to create an objects? What was I supposed to do? I was taught in all of my programming classes that to create an object from a class this is the right way to do it. Does anyone have any idea what these guys wanted from me? Maybe at the next interview I won't get stumped like that again.</p> <p>Thanks for any help,</p> <p>Craig</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload