What is meant by Encapsulation? Can you write a class to
explain encapsulation?
Answer Posted / srinu
Encapsulation=DataHidding+Abstraction is called
Encapsulation is called Encapsulation
EX:-
public class A
{
private String name;
private int age;
publiic setName(String name)
{
this.name=name;
}
public String getName()
{
return name;
}
public setAge(int age)
{
this.age=age;
}
public int age()
{
return age;
}
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What are the major drawbacks of external iteration?
What is difference between call by value and call by reference?
What is math floor in java?
Is ++ operator thread-safe in java?
I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in
What is the numeric promotion?
What do you mean by static variable?
Can we overload the methods by making them static?
What is the abstract class?
What is runtime locatable code?
Is java se open source?
What are the types of methods in java?
Can a serialized object be transferred via network?
What is canonical name in java?
Difference between vector and arraylist.