Difference Java Groovy Program

Difference Java Groovy Program

To move from one language to another, first thing comes in our mind is why should I use another language and what it simplifies. If you are a Java programmer and moving to Groovy then you would like to know first what is the basic difference between them and how Groovy makes programming easy . In this demo first I will show you difference between Java and Groovy using comparison then later through program.

Difference Java Groovy Program

To see more differences please visit groovy-lang.org differences and Groovy program structure

Now let’s see the differences using simple program:

  • Java Program:

  • Above Java program converted to Groovy:

  • Groovy also supports scripting language where you don’t need to define well formed class structure and here you could write program with or without defining the class and call its method:

  • Output of all programs:

Difference Java Groovy Program

Leave a Reply

Your email address will not be published. Required fields are marked *

I am not Robot *