Originally posted by Layne Lund:
The Class.getResource() method in Pat's code above is an instance method. This means that you need a Class object to call it. Alternatively, you can use the static ClassLoader.getSystemResource() method. I'm not sure of the differences between these to methods, so you should probably read the javadocs to see if there are any that will impact your development.
Layne,
If I am not wrong, I guess ClassLoader class is avaiable in the system, where custom class loaders is permitted... In limited systems like in J2ME, we need to use getClass().getResource() method in Pat's way to get into the resources in the jar...
But in desktop application and web application, where custom class loader is present, it won't be a big deal to use ur way or Pat's way, I guess...
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0