Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

class in the interface  RSS feed

 
amar nath jha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the role of class declared inside an interface.
Is it final?
 
gaurav abbi
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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.myQuestMethod1();
obj.iTest = 10;
}
}
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!