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.
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:
- For more details please visit Groovy official documentation