|
Light Poster
|
|
| 18Aug2010,16:58 | #11 |
|
Interesting interview questions. It helped me remember all the answers. Thanks a lot. Would like to see some .NET 3.0 or 4.0 questions too.
|
|
Newbie Member
|
|
| 28Nov2010,01:10 | #12 |
|
Actually, Protected Internal can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.
|
|
Newbie Member
|
|
| 16Jan2011,06:37 | #13 |
|
great post. I like it
|
|
Banned
|
|
| 22Jan2011,16:46 | #14 |
|
It's great help to face the interview.
thanks |
|
Newbie Member
|
|
| 27Feb2011,19:33 | #15 |
|
Here some more good questions questpond dot com
|
|
Newbie Member
|
|
| 8Mar2011,17:06 | #16 |
|
Quote:
Code:
object[] array = new object[] { 1, "abc", new Random() };
|
|
Newbie Member
|
|
| 19Mar2011,01:22 | #17 |
|
Class question "Can you allow a class to be inherited, but prevent the method from being over-ridden?" answer (Yes. Just leave the class public and make the method sealed.) is wrong. You cannot use the "sealed" modifier in a public class that is not over-riding the class that implements the method or property that you want to seal. If you want to stop someone from over-riding a method or property just do not add the "virtual" modifier to it
The following will raise an error. If you switched the GetPerson in the Person class to include the "virtual" modifier then it would work. public class Person{ public string GetPerson(){ } } public class Member: Person{ override public string GetPerson(){ } } |
|
Banned
|
|
| 23Sep2011,17:29 | #18 |
|
Quote:
Originally Posted by Mutayyab Shah Mutable Objects: When you have a reference to an instance of an object, the contents of that instance can be altered Immutable Objects: When you have a reference to an instance of an object, the contents of that instance cannot be altered |
|
Banned
|
|
| 20Oct2011,17:51 | #19 |
|
great package of questions u have shared............. it will definately help c# bginner...
|
|
Newbie Member
|
|
| 24Jan2013,01:00 | #20 |
|
Hieverybody,
Likethe_nell_87, I think the answer in 10th question is not ok (Can you storemultiple data types in System.Array?). If you havea this hierarchy: class Person {}; class Male : Person {}; class Female : Person {}; each Maleor Female object is also a Person object. With an ArrayListobject, I can insert multiple types of the same hierarchy, and then convert theArrayList to an Array using the base type of Person. The following code works fine: Code:
class Person { }
class Male : Person { }
class Female : Person { }
class Program
{
static void Main(string[] args)
{
ArrayList al = newArrayList();
al.Add(new Female());
al.Add(new Male());
Person auxp = new Person();
al.Add(auxp);
Array a = al.ToArray(auxp.GetType());
foreach (Person p in a)
{
Console.WriteLine(p.GetType().ToString());
}
}
}
|

