Implement multiplication in java