Java != javascript, and even if it were, simply dumping your homework assignment here isn't how this works.