answersLogoWhite

0

Can interface have inner class

Updated: 12/17/2022
User Avatar

Wiki User

12y ago

Best Answer

Yes

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can interface have inner class
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does interface contains classes or not?

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.


Is Iterator a class or Interface?

Its an interface.


Is interface class a valid term?

Yes. An interface in essence is a java class and so you can use the term interface class. But, using the term class along with the term interface can cause ambiguity or misunderstandings among novice java developers. So, using the term "Interface" along would suffice to refer to a type of class which is the "Interface"


Why instance in abstract or interface?

we can make object of interface but in abstract we can not make object of it interface ab= new Classs(): in interface we maintain multiple inhetence by use of obj of interface we if inherit two class have same fun then we give the name of that interface and call the pertucular that fun interface ab= new class() ab.add(); but in Astract Class we cannot make object of it only class class wich inherit it can make object class ab2= new Class(); and by obj we call function of drived class ob2.add();


Interface can be defined inside another class?

yes ,interface can be defined inside another class


What is similarities between Abstract Class and Interface?

If a class has one abstract method ,the class has to be an abstract class.Methods can be implemented in abstract class.Whereas a interface is like a abstract class...the only difference being that the methods are never implemented in Interface.


What do you mean by inheriting the interface?

In object oriented programming, a derived class inherits the protected and public members of its base class. Those members therefore define the interface that is inherited by the derived class. The derived class may augment that interface to provide a more specialised implementation of the interface, without the need to re-write the generic interface of the base class. The implication is that the derived class is a more specialised form of the base class.


Inner class oops?

Inner class oops is a program. This program is smaller class within a bigger class.


Can a class write inside an interface?

Yes, you can create a static class inside an interface, but it is normally not a good idea.


What is static inner class?

An inner class declared as static is treated as if it were a normal top-level class.


When you define a c plus plus class what items are considered part of the interface?

The interface of a C++ class is the public methods and attributes that are exposed by the class. In a pure abstract base class, the interface is enforced by the compiler in each of the derived child classes.


What is the latent function of friends?

The only function of a friend is to extend the private class interface outwith the class, essentially making the friend part of the class interface.