-
C# Program to test efficient coding
You have several instances of the following class (User). Provide a class with three methods:"AddUser" accepts a User instance as a parameter and add it to a collection."GetUser" accepts a UserID as a parameter and returns the corresponding User instance. It is important that this executes quickly as it will be used often."GetOrderedUserArray" returns an array of User instances ordered by UserID....
-
Object Oriented and Object Based Language
Explain What are Object Oriented Language and Object Based Language
-
My switch statement works differently! Why?
C# does not support an explicit fall through for case blocks. The following code is not legal and will not compile in C#: switch(x){case 0:// do somethingcase 1:// do something in common with 0default:// do something in common with//0, 1 and everything elsebreak;}To achieve the same effect in C#, the code must be modified as shown below (notice how the control flows are explicit): class Test{public...
-
Which of the following is not a C# reserved keyword
A) IsB) AsC) InD) Of
-
-
Public Members
Why do we use properties rather than public members?
-
AutoPostBack Property
There is Cancel button and OK button on page. When we click Cancel button it skips all validation controls and goes to next page.(a)Page AutoPostback of Cancel is True.(b)Page AutoPostback of Cancel is False.(c)Page AutoPostback of OK is True.(d)Page AutoPostback of OK is False.Which option is correct?
-
C# Data Table Multiple Rows
You have multiple rows in C# data table and you have to save it in database using just one call, How will you do it?
In a multilevel hierarchy how are the constructors are called
A) TopDownB) BottomUpC) None
Why multiple Inheritance is not possible in C#?
(Please do not answer like this-It is possible through Interfaces.)
Which statement is invalid with regards to Constant
A) They must be initialized when they are declaredB) The value of the constant must be computable at compile timeC) Constants are not staticD) Constant is a variable whose value can be changed through out it’s life time when it is static.
Which operator is used for TypeCasting
A) [ ]B) ( )C) TypeOf
C# sealed variables
I have taken a windows application and a button control in it.I want to declare a variable as a sealed and use that variable with in same class as we cannot use in other class. class test { public sealed int x = 5; public void abc() { MessageBox.Show(x.ToString()); } } class best :test { ...
Any process can be divided into multiple
Skill/Topic: AdvancedA) ProgramsB) ThreadsC) Application domains
Divide Two Numbers Without Using Division and Modulus Operator
Write C# code to divide two numbers without using the division and modulus operator
Default Access Specifer
What is default access specifer of a class in C#? Is it internal or private?class foo{ int Var; }In the above code snippet. What is the default access specifier for the variable Var.
Ans