Difference between protected and default access - Java
Difference between protected and default access The default access specifier is one which is not specified with a key word. If no access specifier (any one of private, protected, public) is mentioned it is known as the default access specifier. The methods, variables of class without access specifier can be accessed by classes, methods within the package in which they were declared.
The protected access specifier also has the same scope that of default access specifier and can be accessed in all subclasses of the protected class across packages i.e., packages other than the package in which the protected member is declared / defined.
|
Explain Java’s delegation event model - JavaThe event model is based on the Event Source and Event Listeners. Event Listener is an object that receives the messages / events. The Event Source is any object which creates the message / event...
Describe the assert keyword - JavaThe programmer assumes certain code while developing when handling exceptions. For example, a number is passed as parameter to a method and it is to be validated whether it is positive...