Search Results

Monday, April 6, 2009

C# InterView Question

I am going yo put here some interview questions of C# which will help you in near future.

4 comments:

  1. 1.What’s the implicit name of the parameter that gets passed into the class’ set method?
    (Ans) Value, and its datatype depends on whatever variable we’re changing.

    2.How do you inherit from a class in C#? (Ans)Place a colon and then the name of the base class. Notice that it’s double colon in C++.

    3.Does C# support multiple inheritance? (Ans)No, use interfaces instead.

    4.When you inherit a protected class-level variable, who is it available to?
    (Ans)Classes in the same namespace.

    5.Are private class-level variables inherited?

    (Ans)Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.

    ReplyDelete
  2. 6.Describe the accessibility modifier protected internal.
    (Ans) It’s available to derived classes and classes within the same Assembly (and naturally from the base class it’s declared in).

    7.C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
    (Ans) Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.

    8.What’s the top .NET class that everything is derived from?
    (Ans)System.Object.

    9.How’s method overriding different from overloading?
    (Ans)When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

    10.What does the keyword virtual mean in the method definition?
    (Ans)The method can be over-ridden.

    ReplyDelete
  3. Do you have any idea; What lib is used to access usb in .net platform?

    ReplyDelete
  4. Yes,First i would like to request you to ask question in the C# OPEN DISCUSSION TOPIC.(NO OFFENSE)

    1)Second,yes you have to make your own library to access usb in .NET.

    2)Or you could download built in libraries for your project and re-use that libraries.

    One Email has been sent to your email address which contains the project related to USB Operations.

    THANK YOU FOR VISITING AND ASKING QUESTIONS IN PROGRAMMING SKILLS PLATFORM.

    ReplyDelete