Hi frnds,
I need the ans for below the qus which asked me the interview
I gave the ans but he is not satisfied pl share the ans which u explained infont of the interviewer??
1. Why we use constructor in our application ?? wt is the need?
2. What is destructor??
3. What is finalize and dispose methods with example and what is the use for this?
4. Expalin garbage collector taking with some example??
5. Explain the scenario where u used for and foreach loop and why ??
6. Why we use asp.net?
7. Simple example for the implement interface?
8. Suppose I hv an example
Class class1
{
Public void add (inta,intb)
{
Return (a+b);
}
Public void add (inta,floatb)
{
Return (a+b);
}
My qus is we can change void or not???
9. How to remove the duplicate rows from the table in sql?
10. Why we use enable view state in asp.net?
11. How many non clustered index we can create a table?
My ans is –more then 1
So how much the limie??
12. I have a table like employee
| name | City |
| A | Bangalore |
| B | UP |
| C | Bangalore |
| D | UP |
| E | Bangalore |
| F | Chennai |
I wants to wrire a query for the below op
| Name | ID |
| Bangalore | 3 |
| UP | 2 |
| Chennai | 1 |
13. I have a list
List list = new List();
list.Add(“Bangalore”);
list.Add(“UP”);
list.Add(“Bangalore”);
list.Add(“UP”);
list.Add(“Bangalore”);
list.Add(“Chennai”);
}
Here I wants to use another list and wants to display records only Bnagalore City ?? how??
14.Write the program for without using virtual key in overriding??
15.I have a 2 query
a> Select * from Employee
b> Select col1,col2,col3 from Employee
My qus is which is the better and why?
Joginder BangerPosted Mar 20, 2016, 3:37 PM
Bad way: Select * from Employee
Best Way: Select col1,col2,col3 from Employee
when I used this query "select * from tablename" then this query before display data get the all column name in table stracture and then displayed it.
No, you cannot override a non-virtual method. The closest thing you can do is hide the method by creating a
newmethod with the same name but this is not advisable as it breaks good design principles.But even hiding a method won't give you execution time polymorphic dispatch of method calls like a true virtual method call would. Consider this example:
using System;I hope some question is clear ...left question will be solve .
Thanks
anjali khanPosted Mar 21, 2016, 1:49 AM