Abstraction :-
Refers to the process of exposing only the relevant and essential data.
Encapsulation :-
Hide the complexity. " Encapsulation is hide it's member from outside class or interface.
Difference between Abstraction and Encapsulation :-
Example :-
public class Customer
{
// Abstraction
public string customerCode =" ";
public string customerName =" ";
public void Add()
{
Validate();
CreateDBobject();
}
// Encapsulation
private bool Validate()
{
return true;
}
private bool CreateDBobject()
{
}
}

0 comments:
Post a Comment