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 flush () in java?
What is private static class in java?
What is autoboxing in java?
What is use of arraylist in java?
What is the default value of the local variables?
What is difference between == equals () and compareto () method?
How do I start learning java?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
Why is static used?
What function extracts specified characters from a string?
What are the skills required for core java?
What is java used for?
Explain the protected field modifier?
Which is the class in java?
How does regex work?