Lab1 and Lab2 java