• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

an interview question

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it possible to return an interface reference type by a any java method?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Raja seemakurthi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic