Java Main code