Practice exercises done in Java