Java All in All Solution