A brief definition of the singleton pattern in headfirst is to ensure that a class has only one instance and provides a global access point. Let's take a look at some of the common single case patterns.
1. Lazy mode
Lazy mode means deferred loading
1.Java String can be changed.
It has always been assumed that the value of string types in Java cannot be modified, mainly because the string is final and there is no set method for setting the value. However, the value can be changed by
By Sessionlistenr can listen to the creation and destruction of the session, so first write a class Mysessionlistener, Implement the Javax.servlet.http.HttpSessionListener interface and its sessioncreated (), Sessiondestroyed () methods:
Import
4. Use of timer and timer Task
A timer is a timer tool that is used to schedule a specified task in a background thread, which can be executed once or executed on a regular basis. Each timer object corresponds to a background thread that executes
In the use of preparedstatement to make a vague query to waste some of the trouble, has not paid attention to this problem. In general, we make an exact query, similar to the SQL statement: SELECT * FROM table where name =?, and then call
Java.util.Collections.addAll () method instance¥ I want to play Java.util package Author: DHRTCVC comments: 0 Java Technology QQ Group: 227270512
AddAll (collection, T.) method is used to add all the specified elements to the specified collection.
Write configuration in project development is written in the properties file, but sometimes you need to change the value, but find that you need to restart the service to take effect
/**
* Initialization profile *
/public
void init () {
When Tomcat runs the project, there is a request in the past, the backstage report such a mistake java.lang.IllegalArgumentException:Request header is too large
Reason: The request header exceeds the Tomcat limit. There is no parameter size limit
Train of thought: using stack to implement non-recursive traversal
Steps:
1. exception Handling for Root2. Press root into the stack3. The loop termination condition is NULL for stack s, all elements have been processed4. Access to the current top
Idea: Store the current node in the array, if the current node is a leaf node to print the current array, take the recursive way to operate.
Technique One: is the problem of the array, all the path nodes are stored in an array, because the array
Deadlock refers to two or more than two processes in the implementation process, because of competitive resources or due to each other communication caused by a blocking phenomenon, without external forces, they will not be able to push down. It is
The >1 (1-bit right), which is divided by 2
public static void Main (string[) args) {//>: Right Shift operator, >> 1, equal to divided by 2//>>>: Unsigned right shift, ignoring symbol bit, vacancy all with 0 int a = 10;
Raw number
Shows the need for multiple inheritance in the world, as shown below. Cats and dogs are separate subjects, but they are all pets. They should have the common behavior of pet class.
It seems that cats and dogs need to inherit the pet class, if
UML diagram, in order to show the core of the Proxy mode class relationship, here the details of the section, such as Pursui and schoolgirl relationship is not drawn, the core of the proxy mode is the proxy class and the proxy class is implemented
Topic Description :
Operates the given two-fork tree and transforms it into a mirror of the source binary tree.
Binary tree Mirroring definition: source binary tree
8
/ \
6
/\ /\
5 7 9
Mirror binary
Package com;
Import java.util.ArrayList;
Import Java.util.HashMap;
Import Java.util.Iterator;
Import java.util.List;
Import Java.util.Map;
Import Java.util.Set;
/**
* Player basic Information class
* @author lzq31
*
*/
public class Player {
/
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