Explain the differences between public, private, protected
and static?

Answer Posted / manne ranjith

public-->inherite the protected members as preotected in
drived class and pubic members wiull be public in derived
class

protected--->pubic and protecated members of the base class
will become protected in derived class

Private-->pubilc and proteacted members will become private
in derived class

static--->Method is defined by static cannot access non-static
members or fields of that class. But non-static members can
access static fields or methods.

Is This Answer Correct ?    28 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of http?

522


How do you sort an array in java?

531


what do you mean by marker interface in java?

539


What is unicode with example?

609


Does java list allow null?

529






Can a hashset contain duplicates java?

489


What is toarray method in java?

547


What does yield method of the thread class do?

572


What is a singleton in genetics?

553


How to find the index of the largest number in an arraylist java?

507


What interface is extended by awt event listeners?

584


What is a treeset in java?

538


Why object class is super class for every class in java?

559


What is a null point?

550


What is unicode full form?

542