In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Groovy 2.0 static type checking and how to use the compilation function, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
The Groovy development team recently released version 2.0, Groovy is based on the Java Virtual Machine (JVM), is a dynamic, object-oriented programming language, although it is a dynamic language, but the new version adds static type checker and optional static compilation of some parts of the application, Groovy2.0 also includes syntax enhancement, more modular, can take full advantage of JDK7 dynamic invocation (invoked dynamic) and other features.
Because many Java developers use Groovy as an extension language for nesting, the addition of Groovy static type checking feature allows developers to see error messages at compile time like using Java. If developers use @ TypeChecked annotations in their code, the Groovy compiler will perform static type checking during compilation, pointing out obvious errors such as variable name input errors. The static type checker can also validate the return value. Developers can mix statically typed methods with the language's dynamic features and optional type checking, all thanks to the dynamic nature of Groovy.
Groovy2.0 supports the dynamic invocation feature of JDK7, which enhances the performance of dynamic invocation of Groovy when using the JDK7 version. Because JDK7 can be widely deployed, the Groovy development team added a new @ CompileStatic transformation to include static type checking code, and this version of Groovy also includes some syntax enhancements from the Project Coin project.
To make Groovy more modular, Groovy 2.0 splits the original Groovy Jar file and is organized by several small modules, which halves the core Groovy JAR file size and makes it more portable. Users can now select only the necessary modules and put them into their programs, so the advantage of development is to support the extension of the module. Groovy modules can now provide methods for other classes to use, including JDK or other libraries, which are fully supported and understood by static type checkers and compilers.
The development team originally planned to release this version called 1.9, but a large number of new features in this version made them change their mind, so they named it Groovy2.0.
Groovy2.0 can be downloaded from Codehaus.org under an Apache2.0 license agreement.
After reading the above, have you mastered Groovy 2.0 static type checking and how to use the compilation function? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.