This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

re: A basic question on Java interface and classes

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I an new and I have a basic question on java interface and want to seek your help.
In my program, I have an interface called ApplicationContext from the Spring org.ache.ApplicationContext API and it has a class named
FileSystemXmlApplicationContext which implement the ApplicationContext interface.

In the FileSystemXMLApplicationContext , I have a constructor called FileSystemXMLApplicationContext and a parameter of type String such as
public FileSystemXMLApplicationContext (string path)

My question is that when I call the constructor FileSystemXmlApplicationText and pass in
a String path then what is the returned object do I get? I am confused since I have both the ApplicationContext interface and the class FileSystemXmlApplicationContext which implements the ApplicationContext. Would the returned type be the type of
FileSystemXmlApplicationContext or the ApplicationContext objects when I call the constructor ? Hope that I do not confuse you , and you understand what I mean.

Thank you so much in advance for your help,
Posts: 7108
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on how you declare the variable.
Happily living in the valley of the dried frogs with a few tiny ads.
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic