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
What is the covariant return type?
How many inner classes can a class have?
Tell us something about different types of casting?
Does windows 10 need java?
how does the run() method in runnable work? : Java thread
what do you understand by synchronization? : Java thread
What are the advantages of java inner classes?
What is an enumeration?
What is string in java with example?
What access modifiers can be used for class ?
Is void a keyword in java?
Why can't we use static class instead of singleton?
Explain the importance of finally over return statement?
What are three types of loops in java?
Can a final variable be initialized in constructor?