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
Which is the class in java?
why an outer class cannot be declared as private?
What is the range of a character variable?
What is the importance of static variable?
How do I run java on windows?
What happens if we don’t define serial version uid?
design an lru cache in java?
How many types of operators are there?
What does %4d mean in java?
Tell me about different OOPS concepts.
Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx
What is collection api?
Is math an abstract class in java?
How do you escape sequences in java?
What are the steps that are followed when two computers connect through tcp?