This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 63208

What happened when you tried it?

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

Joined: Oct 13, 2005
Posts: 43970
Or, better still, what did you read in the Java™ Grammar? Hint: look for interfaceMemberDecl.
Don't get me started about those stupid light bulbs.
subject: Class Inside an Interface
It's not a secret anymore!