answersLogoWhite

0

Does interface contains classes or not?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

While not very common an interface in Java can contain a class. Most interface definitions strictly provide an interface and don't include inner classes.

An example is the java.text.AttributedCharacterIteratorinterface found in the J2SE API which includes a public static inner class Attribute. The inner class is accessed externally as AttributedCharacterIterator.Attribute.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Does interface contains classes or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is difference between abstract class and interface in core java give brief answer with example?

Differences:Abstract class can also contain method definitions but an interface can contain only declarationsAll variables in an interface are by default public static and final whereas in Abstract class it is notAn interface can be considered as a pure abstract class that contains no method implementations and contains only declarations.


Why an interface can not have anything but constants and abstract methods?

The idea is that an interface is not a class, it is just a specification of what classes that implement it must contain.


Can you name the legacy classes and interface for collections?

Dictionary, Hashtable ,Properties ,Stack and vector are the legacy classes in java


What is the difference betwen class and interface?

classes can be extended and interfaces can be implemented.


In the field of computers what does the term java interface mean?

In Java, an interface is a suite of methods that multiple different classes are able to implement. Interfaces are not assigned to any particular class. For example, multiple graphics classes can use the same interface to change their size and colour.


What components contains intructions for the system that tells it how to interface with certain device?

The BIOS tells the system how to interface with certain devices in the computer.


Every computer on a network contains an?

Every Computer on a network contains an NIC(Natwork Interface Card). Sajid(Australia)


What is difference in use between interfaces and abstract classes in java?

While neither abstract classes nor interfaces can be instantiated in Java, you can implement methods in abstract classes. Interfaces can only define methods; no code beyond a method header is allowed.


When to use interface?

Interfaces are a way of imposing a type of functionality on all other java classes that are created using it. It is kind of a template that all child classes using this template must follow. All methods that are declared in an interface must be implemented by the child classes and hence the functionality offered by these classes can be controlled using them. Interfaces are a powerful tool that java provides to achieve multiple inheritance.


The slower end of the hub interface contains the youO controller hub?

South Bridge


What is the slower end of the hub interface that contains the you IO controller hub?

South Bridge


Difference between class and interface in java?

A class is a data type. An interface consists of the private, protected and public members of a class, allowing consumers of the class to interact with the class representation in a controlled manner. The private interface is only accessible to the class itself and to friends of the class. The protected interface is similar to the private interface but is also accessible to derivatives of the class. The public interface is fully accessible. The private and protected interfaces are intended purely for use by the class implementers while the public interface is intended for use by both consumers and implementers.