write the Syntax for Function or Method Overriding?

Answers were Sorted based on User's Feedback



write the Syntax for Function or Method Overriding?..

Answer / ashish gupta

class base
{
public virtual func()
{
}
}
class derive:base
{
//override the base funcion..signature n return value
// must be same
public override func()
{
}
}

Is This Answer Correct ?    19 Yes 3 No

write the Syntax for Function or Method Overriding?..

Answer / pritam kumar

class parent
{
public virtual void print()
{
Console.Writeline ("method from parent class");
}
}
class child:parent
{
public override void print()
{
Console.Writeline("method from base class ");
}
}

Is This Answer Correct ?    2 Yes 1 No

write the Syntax for Function or Method Overriding?..

Answer / karthika

retrun type(int , int)
{
statement1;
}

Is This Answer Correct ?    0 Yes 8 No

write the Syntax for Function or Method Overriding?..

Answer / nageswari

void function name(aruments)
{
statements
return()
}

Is This Answer Correct ?    0 Yes 8 No

write the Syntax for Function or Method Overriding?..

Answer / madhu nagidi

//Below is syntax for function
function test_func()
{

}

//Below is syntax for Method Overriding

Class JJ
{
Test_method(string a, string b)
{
a="Google";
}
}
class MM : JJ
{
Test_method(string a, string b)
{
a = "Micorsoft";
}
}
//Here overriding the functionality of the method which is
in Base Class.

Is This Answer Correct ?    1 Yes 11 No

Post New Answer

More C Sharp Interview Questions

Why do we override in c#?

0 Answers  


Is predicate a functional interface?

0 Answers  


What's the difference between class and object?

0 Answers  


What is multiple interface in c#?

0 Answers  


What is difference between for and foreach loop in c#?

0 Answers   MCN Solutions,






Why are dynamic link library used over static one?

0 Answers   C DAC,


Is there regular expression (regex) support available to c# developers?

0 Answers  


C Sharp

1 Answers   Wipro,


What is a concrete class in c#?

0 Answers  


How is exception handling implemented in c#?

0 Answers  


How do you prevent a class from being inherited?

0 Answers  


localization using windows c#

2 Answers  


Categories