Light Poster
18Aug2010,16:58   #11
iamscottj's Avatar
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
GilbertoCode's Avatar
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
tom7nuge's Avatar
great post. I like it
Banned
22Jan2011,16:46   #14
virender.ets's Avatar
It's great help to face the interview.
thanks
Newbie Member
27Feb2011,19:33   #15
khadakbist's Avatar
Here some more good questions questpond dot com
Newbie Member
8Mar2011,17:06   #16
the_nell_87's Avatar
Quote:
10.Can you store multiple data types in System.Array?
No.
While strictly true, the answer to that question is incorrect. There is nothing stopping you from declaring an array of objects, then populating it with a variety of different data types. For example, the following is perfectly legal:

Code:
object[] array = new object[] { 1, "abc", new Random() };
Of course, that's extremely bad practice, but the fact remains that you can do it.
Newbie Member
19Mar2011,01:22   #17
srhone's Avatar
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
sbsl's Avatar
Quote:
Originally Posted by Mutayyab Shah View Post
Anyone ans me that .what is different b/w mutable and immutable?

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
hitesh123's Avatar
great package of questions u have shared............. it will definately help c# bginner...
Newbie Member
24Jan2013,01:00   #20
MarkC's Avatar
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());
}
        }
    }
So, in myopinion the answer is yes.

Last edited by shabbir; 24Jan2013 at 09:22.. Reason: Code blocks