Solutions for my assignments while learning Java