This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes class in the 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 in the interface" Watch "class in the interface" New topic

class in the interface

amar nath jha
Ranch Hand

Joined: Mar 09, 2006
Posts: 42
what is the role of class declared inside an interface.
Is it final?
gaurav abbi
Ranch Hand

Joined: Jan 05, 2007
Posts: 108
even i'm curious about the purpose, but anyway i wrote this dummy code which worked fine, so they are not private, one thing i can say.

interface IQuest{
class MyQuest{
int iTest;
void myQuestMethod1(){

public class Quest implements IQuest{
public static void main(String[] args){
IQuest.MyQuest obj = new MyQuest();
obj.iTest = 10;

thanks,<br />gaurav abbi
I agree. Here's the link:
subject: class in the interface
It's not a secret anymore!