Meaningless Drivel is fun!
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 63355

What happened when you tried it?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 44616
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!