What is shadowing?

Answer Posted / rohit

Whatever the code written by Sonia.sardana is shows the
shadowing concept but there is some print mistakes in the
code.The correct code is---


imports system
module m1
public class base
Public Sub test()
Console.WriteLine("sonia")
End Sub

Public Sub test(ByVal i As Integer)
Console.WriteLine(i)
End Sub

End Class

Public class derived
inherits base

Shadows Sub test(ByVal x As Integer)
Console.WriteLine("Shadow method")
End Sub
end class


Sub main()
Dim obj As New derived
obj.test() 'This will show error
obj.test(10) 'This is valid
End Sub

end module

Is This Answer Correct ?    8 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the role of new keyword?

625


What are the assembly entry points?

590


Define clr?

558


What is tracing?

621


What is break mode? What are the options to step through code?

560






Can you please explain the difference between dispose and finalize()?

512


How to execute VB.NET PROJECTS,VB6.0 PROJECTS AND write their test cases.Need Reply Urgently

2009


What is the use of errorprovider control?

607


What languages does the .net framework support?

551


What is enumerator?

579


difference between checkbox vs radiobutton??

2501


What is deep copy?

578


what is commom language runtime?

565


What is the role of new keyword?

643


what is difference between web.config and machine.config and where it will be ?

496