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
How many bytes is double?
How do you sort a list in java?
What is the difference between arraylist and hashset in java?
Can inner class extend any class?
In the below example, what will be the output?
How will you reverse a link list without using recursion?
What is keyword auto for?
Is math an abstract class in java?
What are the 4 versions of java?
What are the types of java?
Why we used vector class?
Can we declare an array without size in java?
What is java string pool?
What do you understand by synchronization?
What is boolean used for?