Java source code for assignments