/*
* Example of a simple read/write text file
* Here are three examples of
* 1. Example of reading a file into memory (here is StringBuffer)
* 2. Write text in content to a file
* 3. Read the contents of one file and write it to another file
* It
One: Crawl the email address in the webpage
Using regular expressions to match text in a Web page
Copy Code code as follows:
[\\w[.-]]+@[\\w[.-]]+\\. [\\w]+
Split the page content to extract
Import
1. Preparatory work
A. Download the Tomcat Linux package, address: http://tomcat.apache.org/download-80.cgi, we download the version is 8.0, download the way as shown:
B. Because Tomcat installation relies on the Java JDK, we need to determine if
Although we generally think that it is feasible to access private fields and private methods of other classes through the reflection mechanism of Java, it is not so difficult.
Note:It works only if you run the code in a separate Java program, just
One, recursive function, popular say is the function itself call itself ...
such as: N!=n (n-1)!You define the function f (n) =nf (n-1)
and f (n-1) is the function of this definition. This is recursion.
Second, why to use recursion: The purpose
The recent project needs micro-letter payment, and then looked at the micro-letter public number to pay, although not difficult, but the details still need to pay attention to, with a large half a day to write a demo, and a complete test of the
Similarities and differences between Java "equals" and "= ="
First, simply say "equal" and "= ="
The = = Operation compares the values of two variables to the base data type for equality.
For reference variables, the two variables are stored in
The decorator pattern can dynamically add some additional responsibilities to an object. Decorator mode is more flexible than generating subclasses in terms of adding functionality.
The applicable environment for this mode is:
(1) Add
Java.lang.Instrument Proxy Agent uses
The Java.lang.Instrument package was introduced in JDK5, and the programmer dynamically modifies the class code by modifying the bytecode of the method. This is typically done before the class's Main method
I. El Introduction
1. Grammatical structure
${expression}
2.[] and. operator
EL provides. And [] Two operators to access the data.
You must use [] when you want to access a property name that contains special characters, such as. For example:
${user.
In JSP, the method of obtaining the IP address of the client is: Request.getremoteaddr (), which is effective in most cases. But in the adoption of Apache,squid,nginx and other reverse proxy software can not get to the client's real IP address.
If
Velocity uses version 1.7. Under Win7, use IntelliJ idea to create a web App project based on Tomcat named Todo_web, set Path to/todo, and import velocity-related jar packs. Import only Velocity-1.7.jar This package may be an error, as prompted to
It's actually a way to qualify custom annotations by @constraint.
@Constraint (Validatedby = xxxx.class)
Here's what I do. Java Custom Annotations code sample for pre and post parameter verification
Interested in this, please look good, learn
The main operations of Java IO have been finished before
In this section, we'll talk about other aspects of Java IO
serializable serialization
Instance 1: Serialization of Objects
Copy Code code as follows:
Import Java.io.File;
Add the necessary annotations to a good habit that must be possessed by a responsible, morally exemplary front end
Can greatly improve the maintainability of the code, readability.
Java code Comment shortcut key: ctrl+shift+/first familiar with
1. Open various System Tools2. Timed shutdown (reboot, sleep not implemented, please refer to the above two articles to expand themselves)3. Simple File operation
Copy Code code as follows:
[Java]
Package com.cxy.f;
Import
Description1. Let Java execute dynamic code through scripting language2. Use spring to broker a scripting language into an implementation class of Java interfacesThree scripting languages are supported in 3.spring2.5.6 Ruby,groovy,beanshell4. In the
This article mainly for everyone to organize Java common face test questions for your reference, the specific contents are as follows
1. The difference between sleep and wait in Java
① the two methods come from different classes, sleep comes from
First, JSON introduction
JSON (JavaScript Object notation), similar to XML, is a data interchange format, such as Java, which produces a data that wants to be given to JavaScript, and uses JSON in addition to XML;
The advantage of JSON over XML is
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service