| Author |
Can we define a inner class in an interface?
|
Minhaj Mehmood
Ranch Hand
Joined: Jan 22, 2007
Posts: 400
|
|
Can we define a inner class in an interface?
-Minhaj
|
SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Why don't you try it yourself??
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Leonardo Carreira
Ranch Hand
Joined: Apr 07, 2009
Posts: 482
|
|
As far as i know, inner class could be declare in an interface..
this is the code for instantiate and access method :
|
Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
|
 |
Rajiv Chopra
Ranch Hand
Joined: Dec 19, 2008
Posts: 62
|
|
Yes we can declare inner classes in Interfaces too.
best practice is to seprate the implementations from Interfaces.
|
Rajeev Kumar
SCJP 6.0 Certified 96%
|
 |
Salil Vverma
Ranch Hand
Joined: Sep 06, 2009
Posts: 219
|
|
Hi All,
I think,Minhaj's question was about defining not declaring.
Minhaj - we can define and declare the inner class in an interface. As you can see the below mentioned section of code.
|
Regards
Salil Verma
|
 |
Rajiv Chopra
Ranch Hand
Joined: Dec 19, 2008
Posts: 62
|
|
Salil Vverma wrote:Hi All,
I think,Minhaj's question was about defining not declaring.
Minhaj - we can define and declare the inner class in an interface. As you can see the below mentioned section of code.
Hi Salil,
Thanks for example.
Please can you explain the meaning of define and declare seprately.
How we can define? and How we can declare?
Thanks in advance.
|
 |
 |
|
|
subject: Can we define a inner class in an interface?
|
|
|