Skip to content

Instantly share code, notes, and snippets.

@nipunthathsara
Created April 13, 2020 15:50
Show Gist options
  • Save nipunthathsara/5cd7f768011404d219fd2d317c9e5a58 to your computer and use it in GitHub Desktop.
Save nipunthathsara/5cd7f768011404d219fd2d317c9e5a58 to your computer and use it in GitHub Desktop.
Class loading example
package org.example;
import java.util.ArrayList;
import com.sun.crypto.provider.AESKeyGenerator;
public class Foo {
public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println("java.ext.dirs : " + System.getProperty("java.ext.dirs"));
System.out.println("com.sun.crypto.provider.AESKeyGenerator : " + AESKeyGenerator.class.getClassLoader());
System.out.println("Foo : " + Foo.class.getClassLoader());
System.out.println("String array : " + String[].class.getClassLoader());
System.out.println("ArrayList : " + ArrayList.class.getClassLoader());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment