answersLogoWhite

0

Defining an Interface and implmenting it in Java is a security measure. An Interface limits how a Class can be modified and accessed. The security measure is there to prevent an object or user from accessing the superclass and changing an attribute or method that will effect how the class performs at run time or when compiling. The interface also clearly provides a blueprint to a user when implementing the functionailty of a the class. Yet another need for interfaces is when an a class cannot be initialized and needs a special implementation to be required which is accomplished with an Interface.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Need of interface in java?

Interfaces are used in Java to accomplish most of the goals of Multiple Inheritance. For several reasons, Java only supports Single Inheritance for classes - i.e. a class can have only a single parent. The use of Interfaces is how Java attempts to implement most of the positives of the concept of Multiple Inheritance while avoiding its pitfalls.


Why do you use superclass init method inside your init method in a servlet?

Because, that is how all Java classes work. When a class is initialized/created all the classes it extends from (its super classes) need to be initialized as well.


Is it possible to take IFR Training classes online?

No, while you can take some classes online. You will not be able all your classes online>. You need some on-the-job training.


Interface is used in java but not in C why?

The short answer: because C is not object-oriented. The reason for C++ not having interfaces is, that C++ supports multiple inheritance. Because C++ classes can be derived from more than one base class, so there is no need to have interfaces. In Java, each class has exactly one base class (except the class Object). With the help of interfaces it is possible implement a restricted (and more stable) form of multiple inheritance. Interfaces follow implicitly the following rules: * interfaces are abstract * each method is public abstract * each attribute is public static final


What is the 4.4 plan?

its a plan that helps out with your classes and your graduation by telling you what classes you need and what classes you don't need


How do you go super saiyan in budokai?

You can't go super saiyan while in a fight in Tenkaichi Budokai. You need to select a super saiyan character Ashwin Hendre


How do you switch off cam belt light?

You need the equipment that interfaces with the PCM.


Why do you need to set the clock rate on some interfaces and do not need to set the clock rate on other interfaces?

Clock rate must be set on an interface that is the DCE. This provides clocking for the DTE and helps with data transmission across the connection.


Which two of the following are graphics interfaces?

To determine which two are graphics interfaces, I would need the specific options you're considering. Generally, common graphics interfaces include OpenGL and DirectX, which are widely used for rendering 2D and 3D graphics in applications and games. If you provide the list of options, I can help identify the graphics interfaces among them.


What is cwa and aisg mode in tma?

Protocols for interfaces when you need to use RET in your antennas.


How many types of iterfaces?

There are nearly an infinite number of "interfaces." You need to clarify the question: Interfaces to what?


What kind of certification do you need to teach ESL classes?

If you are teaching classes at a university, you will have to get your degree. If you are starting your own classes, you do not really need any certification.