What is shadowing?

Answer Posted / sonia.sardana

If there are overloaded methods in the base class, & u
marks one of the methods as shadows using the keyword
shadow in the derived class, then we cannot access the
overloaded methods.

Ex-
public class base
public sub test()
console.writeline("sonia")
end sub

public sub test(i as integer)
console.writeline(i)
end sub

end class

public sub derived
inherirts base
shadows sub test(x as integer)
console.writeline("Shadow method")
end sub
end class


sub main()
dim obj as new derived
obj.test()-->Invalid
obj.test(10)-->Valid
end sub

Is This Answer Correct ?    22 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

503


Write a VB.Net console program to check whether a number is perfect or not.

6946


Explain enumerator?

526


Explain the advantages of vb.net?

529


What is the strong name in .net assembly?

568






thak you Mr Govind for replying to my question. My next question is that how to retrieve image stored in an SQL server table and assign it to any image control or picture control using VB.net

1707


What is strong name in .net assembly?

533


Explain what observations between vb.net and vc#.net?

561


Using VB, how can you change the Mouse Pointer?

641


What is a static class?

600


Why do you need Lock in Visual Basic?

615


Define naming convention?

632


Explain nested classes?

561


how many server control present in .net

2296


What are the differences between server-side and client-side code?

541