Discussion Locked

fully encapsulated class?

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Recently I attended a interview. The interviewer asked me the following questions which I couldn't answer.
1). What is a fully encapsulated class in Java?
2). What is a TDS driver in java(jdbc)?
Please send me the answer to the above two questions.

ThankYou.

7 replies

by pilson

Hi Praveen,

Encapsulation is the term used for hiding the various attributes (member) of a class by making them private and allowing access to these private members only thru public get/set methods. This avoids wrong values being assigned to the members.

Hence, a fully encapsulated class would have ONLY private members with corresponding get/set methods for each member variable.

Hope this helps.

Regds,
Pilson.

This discussion is closed to new replies.