• Post Reply Bookmark Topic Watch Topic
  • New Topic

what does DBService.class.getClassLoader() load?  RSS feed

 
Rajeev Srikhar
Ranch Hand
Posts: 75
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I know that getResourceAsStream() converts fileName to InputStrteam . But what DBService.class.getClassLoader() does? will it load the classpath which we give to enviromental variable classpath or simply will load the currrent directory path (or root directory) in which DBService is present? please help me in this regard.
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class.getResourceAsStream() is actually a convenience method that performs Class.getClassLoader().getResourceAsStream(). While you can do it explicitly, usually it's just shorter and clearer to call the convenience method instead.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!