A common programming task is to read from one file, modify the content, and then write the contents to another file. Java to implement read, write operations, you need to create multiple classes to produce a Stream to operate.The following is a simple tool class that encapsulates the read and write operations of a file, providing a concise interface.ImportJava.io.BufferedReader;ImportJava.io.File;Importjava
Reprint Please specify source: Jiq Technical Blog-JiyichinSynchronization between threads, in addition to mutual exclusion (the mutex described earlier), there is a collaborative relationship, here we introduce some common among Java threads of collaboration.one, built-in conditional queueJust as each Java object can act as a built-in lock, each object can also act as a conditional queue, called a built-in
In the last year, a server program written using Java NiO was contacted, and the client program invokes the transaction interface provided by the service side by establishing a socket connection and sending a message.Development usually need to send some messages to debug the program, so I wrote a tool. The tool uses swing to write, the primary role is to send a
operation, and after the operation, after the memory growth. Hprof. If memory is growing, it is advisable to 3, 4 times. Then open the histogram (histogram) view separately, and in the object list, compare the retained size changes for each object.The first bit is not necessarily a leaked object, it is possible that it itself is a normal consumption of memory.The object of the leak was the sudden rise in the rankings. The distinguishing method is to look at the memory address of each object, th
Expressions the * @returnBoolean - */ in Public Static Booleanreg (String str, string reg) { the BooleanMatch =false; the About Try { thePattern pattern =Pattern.compile (reg); theMatcher Matcher =Pattern.matcher (str); theMatch =matcher.matches (); +}Catch(patternsyntaxexception PSE) { -msg = Conserror. Error_illegal_regex +pse.getmessage (); the logger.error (MSG, PSE);Bayi } the the returnmatch; - } -}At this point,
JUnit is a Java Unit Test tool, and in general Eclipse integrates this JUNIT4 test toolSince it is a test tool, although the development is used more, but as testers also need to have the idea of junit testing, and more technology does not press the bodyHere is a brief description of the usage:1. Create a junit4test project in eclipseClick "File", "New", "
How to get an HTTP request for a Java program by grabbing the package tool fiddlerSource code: Http://www.zuidaima.com/share/1550463683824640.htmGrab Bag tool Fidder is a very lightweight software that can get browser, program Http,https request.Encyclopedia Address: http://baike.baidu.com/view/868685.htmWebsite address: http://fiddler2.com/Firefox's Fidder plugi
. The behavior of this convenient method is the same as that of C.addall (arrays.aslist (elements)) ,But in most implementations, this method can be much faster to run.import Java.util.arraylist;import java.util.arrays;import java.util.List; Public classCollectionsTest2 { Public Static voidMain (string[] args) {string[] str={"Hello","Nihao","say"," Love"}; Listarrays.aslist (str); ArrayList List2=NewArrayList (); List2.addall (List1); System. out. println (LIST2); }} Like on the point
ClasspyClasspy is a graphical Class file analysis tool, similar in functionality to JAVAP, and the interface primarily refers to the Java Class Viewer:Why re-creating wheels?It took nearly a week to write this tool, so why waste time reinventing a wheel? Mainly because of the following reasons:
By writing a class parser yourself, you can thoroughly understa
just open source is a fully tested Java tool class. The current code has undergone a complete test and is applying to the MAVEN central repository. The address is as follows:Https://github.com/Jimmy-Shi/bean-queryinstructions for use are as follows:Bean-queryClick here for 中文版 version.Beanquery is a Java tool library t
Java Development Tool IntelliJ IDEA Tutorial: unit test and code coverage
This article shows how to use IntelliJ IDEA to develop Unit Testing and Analysis coverage.
1. Create a new project
Create a Java project named UnitTestingApp.
2. Create a class for testing.
Create a new class for testing.
The add method sayHello returns the Hello string.
3. Create a test
This article link: http://blog.csdn.net/xietansheng/article/details/70478082
Usually the development of JAVA projects requires the Unified management log (log) output, such as control of the log information delivery destination (console, file, etc.), control the output format of each log, the log is divided into different levels. The more mature Java log management tools commonly used are the log4j of Apach
If there is no method or work to read the annotation, the annotation will not be more useful than the annotation. An important part of the annotation process is to create an annotation processor. Java se5 extends the reflection API to helpProgramQuickly construct a custom annotation processor.
Annotation processor class library (Java. Lang. Reflect. annotatedelement ):
Izpack is an open-source installation and production tool written in Java. The things made are basically quite satisfactory.Many Chinese problems encountered during use are solved as follows:1. garbled characters on the Chinese interface:Modify CHN. xml. the encoding of this file is strangely transcoded, and it takes only a few days to complete the test. Edit the scrapbook page and evaluate it as follows:Co
Parasoft Jtest is one of Parasoft's integrated solutions to improve productivity and software quality methodologies for development teams. It focuses on methods for validating Java code and applications, and integrates seamlessly with Parasoft soatest to ensure end-to-end functionality and stress testing for today's complex, distributed applications and business.>> Download the latest version of Parasoft jtest trial Today, we share a few Parasoft Jtes
1. Introduction
In an earlier article (see Test Infected:programmers Love writing Tests, Java Report, July 1998, Volume 3, number 7), we described how to use a simple framework to edit Write repeatable tests. In this article we'll take a quick glance at the details in it and show you how the framework itself is structured.
We study the Juint framework in detail and think about how to construct it. We have found many lessons at different levels. In t
Recently Learning MyBatis official documents, see the "Project Document" section has a lot of content has not seen, make a note, understand.
The introduction of the encyclopedia, I can even understand, then do not find other places of information. JDepend an open source code that can be used toExcellent tool for evaluating Java program Quality (definition) , it iterates through the
PMD is an excellent tool for code checking of Java programs. It can check whether the Java code contains unused variables, whether they contain empty fetch blocks, whether they contain unnecessary objects, and so on.But in the course of use, you will find that there are a lot of error and warning in the PMD plugin, although PMD encourages programmers to improve t
1.jd-eclipsePersonally like this, if you use to write code when you encounter a third-party library that cannot find the source code, and you need to look at the specific implementation of the library, then you need to use this thing. And if you're using Eclipse, there's an eclipse plugin jadclipse,jadclipse that provides a class file viewer that can directly open a class file to view its anti-compiled source code, too convenient, too convenient!: JAD Java
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.