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

What are the difference between dispose(), close(), exit(), end()?

584


What is the significance of delegates?

602


What is econo-jit?

691


What is jagged array in vb.net?

740


Explain about the keyword must inherit?

655






Define naming convention?

694


what is interface and when it is used?

1908


What is the use of errorprovider control?

667


What are the advantages of vb.net and c#?

736


what is common language specification?

594


Explain cls?

670


Explain the difference between vb.net and c#, related to oops concepts?

576


What is the source code for display the picture in button click event?

774


Explain how does the xmlserializer work?

672


Write a program to find all text files in a logical drive and return the count of the number of files?

2357