| Author |
an interview question
|
Raja seemakurthi
Greenhorn
Joined: Jun 28, 2007
Posts: 17
|
|
|
is it possible to return an interface reference type by a any java method?
|
Thanks,
Raja
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16690
|
|
Originally posted by Raja seemakurthi: is it possible to return an interface reference type by a any java method?
Do you mean something like this? Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Raja seemakurthi
Greenhorn
Joined: Jun 28, 2007
Posts: 17
|
|
yes, exactly i want that only. he asked me whether we can return a List type from a method. later he asked me other quesstion, ie.... if a method can return an interface type then , is it feature of OOPS ar Java? i said this is OOPs feature only.
|
 |
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
|
|
See if you can do a quick survey and tell how many languages have something comparable to Java's interface. The concept of a pure abstract type like that has been around, but Kent Beck's Implementation Patterns says something like Java is one of the first "mainstream, commercially successful" languages to have "interface" in the language. I just had to look back at a Turbo Pascal program ... it had "Interface" and "Implementation" keywords to mark off blocks of code even before OO, but I don't recall them being polymorphic.
|
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
|
 |
 |
|
|
subject: an interview question
|
|
|