• Post Reply Bookmark Topic Watch Topic
  • New Topic

re: A basic question on Java interface and classes  RSS feed

 
tom mi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Knute Snortum
Sheriff
Posts: 4270
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on how you declare the variable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!