How to improve the speed of writing java programs
Generally, if you want to write a program well and complete it within a period of time, you must use ready-made things. In a new function, how to call ready-made things? Just use third-party packages or use your own code base. Next, we introduce some good code libraries.
General library
Apache's centralized packages that are often used, such as the apache commons package and the goole guava package, you need to know at least a few key classes such as StringUtils class, these and others need to remember their usage. At least most of the string processing work can be done in StringUtils.
Time processing class
In the past, JodaTime was mostly used. This library can help solve many time processing problems, but after java8 came out, using java8 new Time processing is also very convenient, but we are generally accustomed to using the Date class. How to efficiently complete event processing? I myself summarized a DateUtil class, which contains time processing methods that I often need to use.
Collection class library
Collection is one of the most frequently used ones. In work, most of them will use ArrayList, HashMap, and HashSet, these three collection classes. This Apache Commons Collections library can handle the parts that many classes need to deal with. I personally recommend that in addition to the three commonly used collection classes, you need to know more about other collection classes and use them in some special occasions, because other Collection classes are designed to be suitable for some special occasions and are more efficient than common classes.
Encryption Library
Commons Codec in the Apache Commons family provides some public codec implementations, but I personally recommend maintaining your own encryption library. Because jdk already provides native encryption algorithms, you need to encapsulate them yourself, and the tool class you maintain is to centralize these algorithms.
Unit testing library
Unit testing is a very neglected one, but it is a very important one. I use JUnit, a testing library that I often use in my work. Mockito and PowerMock, these three testing libraries meet most situations. If you use it skillfully, you can increase the unit test coverage to a certain ratio during the development process. If you run the unit test every time you change the code, then the code you maintain will have few errors.
Recommended tutorial: Java tutorial
The above is the detailed content of How to improve the speed of writing java programs. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor