answersLogoWhite

0

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

14y ago

What else can I help you with?

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


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 is the difference betwen class and interface?

classes can be extended and interfaces can be implemented.


Can you compile interface in java?

In Java, you cannot compile an interface directly because interfaces themselves are not executable; they are meant to define a contract for classes that implement them. However, you can compile the interface along with the implementing classes. When you compile a Java program, the Java compiler generates bytecode for all classes and interfaces, which can then be executed by the Java Virtual Machine (JVM).


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.


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.


What is constructive interface?

A constructive interface in programming refers to an interface that guides or enforces certain design guidelines or principles on how classes implementing the interface should be structured. It helps ensure consistency in how classes interact with each other and promotes good software design practices.


Every computer on a network contains an?

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


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.


Is a inference a type of variable?

No an Interface is a type of class that is designed to support partial multiple inheritance in Java. Interfaces are used to create skeleton classes that can direct the functionality of all classes that implement them. Interfaces have only method declarations and the class that implements the interface must provide the implementations for them