Create Example.java

Added example file with comments about what is happening