6. What are the access modifiers in java ?
There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.
7. What is are packages?
A package is a collection of related classes and interfaces providing access protection and namespace management.
8. What is meant by Inheritance and what are its advantages?
Inheritance is the process of inheriting all the features from a class. The advantages of inheritance are reusability of code and accessibility of variables and methods of the super class by subclasses.
9. What is the difference between superclass and subclass?
A super class is a class that is inherited whereas sub class is a class that does the inheriting.
10. What is an abstract class?
An abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete.
Comments
Post a Comment