Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is shadowing
What is shadowing ?
✍: Guest
When two elements in a program have same name, one of them can hide and shadow the
other one. So in such cases the element which shadowed the main element is referenced.
Below is a sample code, there are two classes “ClsParent” and “ClsShadowedParent”. In
“ClsParent” there is a variable “x” which is a integer. “ClsShadowedParent” overrides
“ClsParent” and shadows the “x” variable to a string
Public Class ClsParent Public x As Integer End Class Public Class ClsShadowedParent Inherits ClsParent Public Shadows x As String End Class
2007-10-23, 7838👍, 0💬
Popular Posts:
How did you implement UML in your project ? PART II Implementation phase / Coding phase (Class diagr...
Can you prevent a class from overriding ? If you define a class as “Sealed” in C# and “NotInheritab...
What is the difference between strings and character arrays? A major difference is: string will have...
What print out will the folloging code produce? main() { char *p1=“name”; char *p2; p2=(char*)malloc...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...