java - Difference between methods to getResourceAsStream -
can tell me what's difference between myclass.class.getclassloader().getresourceasstream("testfile.txt") , myclass.class.getresourceasstream("testfile.txt")
they (more or less) equivalent. class#getresourceasstream() classloader internally , delegate getresourceasstream phone call it.
thanks vgr's comments. it's of import note class#getresourceasstream(string) first delegates class#getresource(string) which, if doesn't start /, transforms string argument passed pre-pending bundle name of corresponding class / replacing each ..
java class resources classloader
No comments:
Post a Comment