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

What is the difference between field and variable in c#?

0 Answers  


Which is the best institute in hyderabad to learn Sharepoint Portal?

68 Answers   IBM,


Why do we need nullable types in c#?

0 Answers  


In which way you can convert a value-type to a reference-type?

0 Answers   Siebel,


Are c# strings null terminated?

0 Answers  






What is the difference between throw and throw ex?

0 Answers  


How do you mark a method obsolete?

0 Answers  


Where is c# compiler located?

0 Answers  


How many types of serialization are there in c#?

0 Answers  


How can we set class to be inherited, but prevent the method from being over-ridden?

0 Answers  


Which is better python or c#?

0 Answers  


Why do we use dictionary in c#?

0 Answers  


Categories