Modefy Java's two dim array snippets