Various Java Problem solutions