what is the difference between the "protected and default"
modifiers?

Answer Posted / firoz

default can be accessable in same class & same package.
protected can be accessed in same class,same package and
subclass.

Is This Answer Correct ?    29 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is heap memory?

658


What are the drawbacks for singleton class?

520


What is ide with example?

548


Should database connections be singleton?

570


Can you use abstract and final both with a method?

573






When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

767


What do you know about the garbage collector?

616


Difference between linkedlist and arraylist.

592


What is a bubble sort in java?

547


how to deploy apache tomcat server to weblogic server in java

1599


Why is String immutable?

624


How do you bind variables?

531


Why java strings are immutable in nature?

594


what is synchronization? : Java thread

563


What is the meaning of 3 dots in java?

682