This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Class Inside an Interface" Watch "Class Inside an Interface" New topic
Author

Class Inside an Interface

Vipul Gulhane
Greenhorn

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{
a()
{
System.out.println("hiii");
}
}

}


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

}

}

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60767
    
  65

What happened when you tried it?


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

Joined: Oct 13, 2005
Posts: 37945
    
  22
Or, better still, what did you read in the Java™ Grammar? Hint: look for interfaceMemberDecl.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class Inside an Interface
 
Similar Threads
Interface and interface methods
instanize interface?
interface as a function parameter?
class inside interace
Uniqueness of static variable