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 is a predicate method?
Java.util.regex consists of which classes?
What is json parser in java?
How many types of the indexof method are there for strings?
Which is better singleton or static class?
Explain about static nested classes in java?
List the different types of classloaders in java.
What is the base class of all classes?
What is the meaning of find and replace?
What are keywords in programming?
What is == and === in javascript?
Can we print null in java?
how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion... ANS:--- >executeupdate method is having boolean return type, if anything goes wrong in data insertion or data updation, it would return false. otherwise, if it successfully inserts data into the database, it would return true NOW HOW TO I CHECK IN MY DURING EXECUTION WHETHER IT RETURNS TRUE OR FALSE... WELL IT WILL DISPLAY ANY MESSAGE OR NOT
What does the append?
What is the formula to calculate percentage?