- What’s the implicit name of the parameter that gets passed into the class’ set method? Value, and its datatype depends on whatever variable we’re changing.
- How do you inherit from a class in C#?Place a colon and then the name of the base class. Notice that it’s double colon in C++.
- Does C# support multiple inheritance?No, use interfaces instead.
- When you inherit a protected class-level variable, who is it available to? Classes in the same namespace.
- Are private class-level variables inherited? Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.
- Describe the accessibility modifier protected internal. It’s available to derived classes and classes within the same Assembly (and naturally from the base class it’s declared in).
- 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? 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.
- What’s the top .NET class that everything is derived from? System.Object.
- How’s method overriding different from overloading? When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.
- What does the keyword virtual mean in the method definition? The method can be over-ridden.
Interview Questions C Sharp set-1
Posted by
study
|
Tuesday 7 June 2011
Popular Posts
-
What is software engineering, anyway? Some basic def...
-
Technical Interview Questions 1. Which is the best page replacement algorithm and why? 2. What is software life cycle? 3. How much time...
-
Q: What are Checked and UnChecked Exception? A: A checked exception is some subclass of Exception (or Ex...
-
Q: Is next a keyword in Java? A: No, next is not a keyword. Q: ...
-
Explain user defined exceptions in oracle. A User-defined exception has to be defined by the programmer. User-defined exceptions are decla...
-
1. For a parallel plate capacitor which is being charged out of the following the incorrect statement is – a). Energy stored in the capaci...
-
1.In the command scanf, h is used for Ans. Short int 2.A process is defined as Ans. Program in execution 3.A thread is Ans. Deta...
-
Q: What is the difference between an Interface and an Abstract class? A: An abstract class can have inst...
-
Explain the attributes of implicit cursor a. %FOUND - True, if the SQL statement has changed any rows. b. %NOTFOUND - True, if record was...
0 comments:
Post a Comment