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

What are jagged arrays ?

637


Explain the use of new keyword?

636


Did vb6 support multi-threading ?

617


How would you implement inheritance using vb.net?

593


Explain the difference between web.config and machine.config and where it will be ?

577






What is the purpose of objects present in asp.net?

647


i have two class that contain's two methods as same name in derived class i have to call these two methods what will happen at run time ?

2324


Can you please explain the difference between authentication and authorization?

617


Explain about the performance of visual basic?

680


What is the strong name in .net assembly?

644


what's ArrayList in .Net (VB.Net or C#).What's the advantageous using ArrayList.

668


So you know which dll is used for microsoft .net run time?

612


Explain manifest?

575


Name the class which allows an element to be accessed using unique key?

638


my project run very wel in my sytem yhen i am deploying my project on client machine ,after deployment i run my project then it show " can no find server name " what i do .

1631