• 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

Binding an Interface without Implementing it in class

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I've a open-source code, in which they defined an interface in class. They dint use that interface through implementing/extending it. I mean, in any of the class or interface they dint do extends or implement of that interface. They are using google juice. Let me show you the code of that class,


In this class CandidateElementExtractorFactory AND FormHandlerFactory are the two interfaces, they dint use anywhere in whole project. Still they are easily getting an instance of the class CandidateElementExtractor in another class. Let me show the code of another class, how they are getting instance


In constructor they are doing this.candidateExtractor = elementExtractor.newExtractor(browser);. Suppose If I extends the CandidateElementExtractor.class, I'm not getting the instance of child. It is showing an exception like,



My child class is like this,



in another class, I'm getting instance like this,


but it is giving an exception like above I mentioned.
Is there any idea, why this exception is coming.

Thanks:
Ramakrishna K.C
reply
    Bookmark Topic Watch Topic
  • New Topic