Questions On C# - I
Posted by Subash | 6:29 PM
[1] Comments
General C# Questions
- Does C# support multiple-inheritance?
- Who is a protected class-level variable available to?
- Are private class-level variables inherited?
- Describe the accessibility modifier “protected internal”.
- What’s the top ._NET class that everything is derived from?
- What does the term immutable mean?
- What’s the difference between System.String and System.Text.StringBuilder classes?
- What’s the advantage of using System.Text.StringBuilder over System.String?
- Can you store multiple data types in System.Array?
- What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
- How can you sort the elements of the array in descending order?
- What’s the ._NET collection class that allows an element to be accessed using a unique key?
- What class is underneath the SortedList class?
- Will the finally block get executed if an exception has not occurred?
- What’s the C# syntax to catch any possible exception?
- Can multiple catch blocks be executed for a single try statement?
- Explain the three services model commonly know as a three-tier application.
C# OOP
- What is the syntax to inherit from a class in C#?
- Can you prevent your class from being inherited by another class?
- Can you allow a class to be inherited, but prevent the method from being over-ridden?
- What’s an abstract class?
- When do you absolutely have to declare a class as abstract?
- What is an interface class?
- Why can’t you specify the accessibility modifier for methods inside the interface?
- Can you inherit multiple interfaces?
- What happens if you inherit multiple interfaces and they have conflicting method names?
- What’s the difference between an interface and abstract class?
- What is the difference between a Struct and a Class?
12:00 PM
Can you store multiple data types in System.Array?
If you search the answer for this questions, you will find most websites just copy the answer "No", but actualy the correct answer should be Yes, because the code below proves it:
System.Object[] test_array = new System.Object[6];
test_array[0]="123go!";
test_array[1]=2007.7;
test_array[2]=true;
.......
Submitted by Jim Lee