1:What is the difference between an encapsulation and abstraction?
2. When to use encapsulation?
3. When to use an abstraction?
1:What is the difference between an encapsulation and abstraction?
2. When to use encapsulation?
3. When to use an abstraction?
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
Nilesh JadavRank #109 · 20.3K reputationPosted Oct 19, 2015, 10:51 PM EDT
Read this Link to Know When to use Abstraction :
http://www.onlinebuff.com/article_oops-principle-abstraction-in-c-with-an-example-and-explanation_5.html
public class School
{
private string Schooldepartname;
public string SchoolDepartname
{
get
{
return Schooldepartname;
}
set
{
Schooldepartname =value;
}
}
}
public class Departmentmain
{
public static int Main(string[] args)
{
School d= new School();
d.SchoolDepartname="Communication";
Console.WriteLine("The Dept. Name is :{0}",d.SchoolDepartname);
return 0;
}
}
Thank you ! Hope that Helps !!
Munesh SharmaRank #174 · 13.9K reputationPosted Oct 6, 2015, 7:55 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Oct 6, 2015, 7:56 PM EDT
David SmithRank #999 · 2K reputationPosted Oct 6, 2015, 7:58 PM EDT
Sujeet SumanRank #790 · 2.9K reputationPosted Oct 19, 2015, 10:31 PM EDT