Java programming code