• 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

re: A basic question on Java interface and classes

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
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,
Tru
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on how you declare the variable.
reply
    Bookmark Topic Watch Topic
  • New Topic