See Java Console for Java output and below for JavaScript output: