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 features of c# which are not present in vb.net?

647


Explain nested classes?

552


What is jagged array in vb.net?

628


Explain the difference between system.string and system.stringbuilder classes?

521


Observations between vb.net and vc#.net?

565






What is redim keyword and its use?

581


What is an application domain? how they get created?

577


Name the tool which can convert visual basic old version to .net compatibility version?

507


What is the difference between readonly variable and constant variable?

551


How many ways the function can return values?

523


Sir, what code to store data from vb net sql server 2008 to 2005 and at the same time in order to validate the data entered is not the same, but there have been contacts in the module. Examples such as the log table that I created, the user name as the primary key.

1741


What are the various open source tool available for VB.NET?

557


Explain how to send xml file on server using http protocol?

494


What is the difference between datagrid and gridview?

507


Why do we use ansi keyword?

560