• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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: 7123
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.
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic