Interview Questions-2
output of following program and if any errors what should be the correct syntax
class baseclass
{
public void func1() {Console.WriteLine("Base Fun1()")}
public virtual void func2() {Console.WriteLine("Base Fun2()")}
public virtual void func3() {Console.WriteLine("Base Fun3()")}
}
class derivedclass :baseclass
{
new public void func1() {Console.WriteLine("derived Fun1()")}
public override void func2() {Console.WriteLine("derived Fun2()")}
public new void func3() {Console.WriteLine("derived Fun3()")}
}
class Program
{
static void Main(string[] args)
{
baseclass b = new derivedclass();
b.func1 ();
b.func2 ();
b.func3 ();
}
}
2. string str="hello"; write a program to reverse the string and also find the duplicate characters and remove the duplicate characters from string.
3. ref and out keyword?
4. what are value types and reference types in c#? Explain with example?
5.Steps to implement dependecncy injection in .net core?
6. Steps to implement authentication and authorization in .net core, .net mvc?
7. How do you establish db connection in .net core,.net mvc?
Comments
Post a Comment