added threads examples for java
changed .gitignore to ignore all .class files