File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Class Inside an Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Class Inside an Interface" Watch "Class Inside an Interface" New topic

Class Inside an Interface

Vipul Gulhane

Joined: Mar 28, 2011
Posts: 20
can we declare class inside the interface
If Yes Then
Why we Define a Class Inside an Interface....
See I have one inteface whic have class
public interface abc
class a{


public class interfacetest implements abc{
public static void main(String a[])
a ss= new a();



Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

What happened when you tried it?

[Asking smart questions] [About Bear] [Books by Bear]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46402
Or, better still, what did you read in the Java™ Grammar? Hint: look for interfaceMemberDecl.
I agree. Here's the link:
subject: Class Inside an Interface
It's not a secret anymore!