Real Time sample code for Encapsulation and Abstraction.
where to use abstract and where to use specifies like
public private.
Answers were Sorted based on User's Feedback
Answer / ravikiran
Encapsulation & Abstraction:
The private variable declaration is abstration,and making
usage of getters and setters is encapsulation
private String name="";
private String school="";
public String getName()
{
return name;
}
public void setName(String name)
{
this.name=name;
}
When We use private when we want to restrict the access
within the class.
When we use public then the variable or method will be
accessible in all the locations
| Is This Answer Correct ? | 18 Yes | 1 No |
Answer / manikandan [ gtec,vellore ]
Encapsulation is used when v need to use a data with the
object access.
Abstraction is used when v need to restrict the end user to
access all process.
| Is This Answer Correct ? | 1 Yes | 10 No |
What are the data types supported by java?
How are this() and super() used with constructors in java programming?
Explain the concept of polymorphism with examples?
Difference between string, string builder, and string buffer?
What is constructor chaining and how is it achieved in java?
Can long be null in java?
What is the difference between && and & in java?
Does java initialize arrays to zero?
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.
2 Answers iGate, Seed Infotech,
What is dynamic array in java?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
Can we write method inside a method in java?