what is difference between shadows and private?
plz anyone can tell me with example?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaish MathewsRank #225 · 11K reputationPosted Jul 26, 2010, 10:47 AM EDT
We can't differentiate both as both are different concepts. I think you know what meant by "private". It's using for simply to restrict access from out side world.
Now shadowing. It's basically VB.NET key word. It's equivalent in C# is hiding and in C# it's implementing using key word "new". Shadowing or hiding feels like overriding, but difference is there.
The shadow keyword allows you to hide a base implementation in an inheritance
hiearcy. This is useful in situations, such as a base class change declaring
a method already defined in your derived class. Redifining access levels, or
the readability/writeability of a property
Check here for some difference between shadowing/hiding and overriding
http://www.c-sharpcorner.com/UploadFile/jaishmathews/DifferentiateHidingandOverriding02252006123905PM/DifferentiateHidingandOverriding.aspx?ArticleID=ea4ba754-8b02-4bde-8f96-a90b428d3656