In Java you will often see errors about null pointer exceptions, and it is difficult to find such errors, simply summarize.· Causes of NULL pointer exceptions:1, the string variable is not initialized. String Str. You create a null pointer exception
Request.setcharacterencoding ("Utf-8"); Response.setcontenttype ("Text/html;charset=utf-8");This is the code that sets the character encoding in the servlet, but usually there is more than one servlet, so we need to write the above code in every
Annotations are currently very popular, and many mainstream frameworks support annotations, and when you write your own code, you try to use annotations as much as possible, but the code is more concise.The syntax of annotations is simple, except
1) refer to the first group by \1public static void Main (string[] args) {String content= "hello world!"; String regextstr= ".*?"; Pattern pattern=pattern.compile (Regextstr, pattern.case_insensitive); Matcher Matcher =pattern.matcher (content), if
Using the class's static fields and constructors, we can track the number of objects created by a class. Write a class that can query it at any time "how many objects have you created?" ”。Package JXL;Class sum{public static int a=0;int C1;public sum
Class Mytestclass {public int Value;public boolean equals (Mytestclass obj) {return obj. Value ==this. Value;}Public mytestclass (int initvalue) {Value = InitValue;}}This is the constructor of the class, or the constructor, which is called
From:http://outofmemory.cn/c/java-outofmemoryerrorJava.lang.OutOfMemoryError This error I believe most developers have encountered, the cause of this error is mostly due to the following reasons: The JVM memory is too small, the program is not tight,
Original address: http://blog.csdn.net/xiaanming/article/details/17483273Previously did not understand what called the callback, every day listen to people say add a callback method What, my heart think I grass, what is called callback method ah?
Thinking question 1In the early days we often defined variables like thisint value=100;The preceding example defines the variableMyclass.obj=new MyClass ();Are the variables defined in these two ways the same?Not the same. The former defines the
Java concurrency tool class ForkJoin task decomposition, tool class forkjoinIntroduction to the Fork/Join framework
Step 1: Split the task. First, we need a fork class to split large tasks into subtasks. It is possible that the subtasks are still
Java concurrency deadlock instance, java dead instance
1 package com.thread.test.thread; 2 3 /** 4 * Created by windwant on 2016/6/3. 5 */ 6 public class MyTestDeadLock { 7 public void run() { 8 MyThread mt = new MyThread(); 9
HashMap specifies the initial capacity. For JDK computing of different versions, hashmapjdk
The constructor of the specified initial capacity of HashMap:
public HashMap(int initialCapacity, float loadFactor)
The initial capacity is based on the
Difference between Vector and ArrayList in Java, vectorarraylist
First, we can see that both of these classes implement the List interface, and the List interface has three implementation classes: ArrayList, Vector, and sorted List. List is used to
Java heap, Java
Features:
The memory area shared by the thread created when the VM is started. The memory area is allocated to all instance objects and array objects.
Main area of GC spam Mobile Phone Manager management, GC heap
The
For how to upload files under the Struts2 framework, the struts2 framework
Struts2 configuration process
(1) Add a jar package to the Project
(2) filter configuration in web. xml
struts2
Java object creation process, java object Creation
1. jvm finds the class file path.
2. The jvm loads the class file, performs static initialization, and creates a class object.
3. allocate memory space for the objects to be created.
4. clears
Conversion between List and Json, and between ListJson
List and Json conversion require six jar packages. If you do not reference these jar packages, you need to write a large amount of code, here, the conversion using the jar package is recorded
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