1. Data Types in Java are classified into basic data types and complex data types.
Int Is the former, and integer is the latter (that is, a class ).
2. During Initialization
CopyCode The Code is as follows: int I = 1;
Integer I = new
The nullpointerexception encountered in the project is divided into two situations:
1. Reference an empty object, that is, call the method of the empty object or reference the attribute of the null object.
2. Assign the encapsulation class of the
1. Configure the Tomcat virtual directoryCreate the folder javaweb on disk D, and then add the WEB-INF folder and its content. Create an index.html page and write anything at will.
Add the following content to the Host node in the full webapps/conf/
You cannot simply use the clone method to clone objects in JAVA. The clone method is just a shortest clone. See the following:
Deep clone class:Java code
Copy codeThe Code is as follows: import java. io. ByteArrayInputStream;
Import java. io.
The procedure is as follows:
Copy codeThe Code is as follows: View Code
/*
* Hanoi tower Game Problem description:
* Tower of Hanoi: The Tower of Hanoi (also known as Hanoi) is an ancient and legendary educational toy.
* When the world was created
1. Basic data type
Integer:
1 byte
Short 2 bytes
Int 4 bytes
Long 8 bytes
Character:
Char 2 bytes
Floating point:
Float 4 bytes
Double 8 bytes
Boolean:
Boolean 1 byte
2. added a binary integer in java 7.
Starting with 0 B or 0 B
3. A 16-bit Unicode
In traditional Java programming, you no longer need to process Java objects or locations from the memory. When you discuss this in the Forum, the first question raised is: Why do you need to know the Java object address? It is an effective problem.
Regular Expressions are highly efficient in processing strings.
The use of regular expressions involves more experience. If you are interested, refer to relevant books.
Here we mainly write the regular expression Operation Method in java.
Instance 1:
In java, there are two ways for native to parse xml documents:Dom parsing and Sax Parsing
The Dom resolution function is powerful and supports addition, deletion, modification, and query. During the operation, the xml document is read to the memory
Note: When learning to use the selvert filter to process Chinese garbled characters, UTF-8 is used to process Chinese garbled Characters During filter configuration initialization, while gbk is used in the submitted jsp page. Although the two types
Regarding the differences between hiding and overwriting, we need to mention RTTI (run-time type identification), that is, Runtime polymorphism. When a parent class references a subclass object,See the following code:
Copy codeThe Code is as follows:
#. There are two types of memory in java. Stack and heap respectively ).
Stack is the program memory space. Therefore, all basic types and object references exist in the stack.
Heap is the storage object of the Java Virtual Machine. It is a huge
Instance program:1. Use flock to read integer or float data from the keyboard
Copy codeThe Code is as follows: // import java. io .*;
Import java. util .*;
Public class InputTest {
Public static void main (String [] args ){
Callback in = new
Usage:
(Type Variable instanceof class | Interface)
Purpose:
The instanceof operator is used to determine whether the previous object is a later class, or its subclass or implementation class instance. If yes, true is returned. Otherwise, false is
Add necessary comments to make it a good habit for a front-end with a sense of responsibility and a moral model,
This greatly improves the maintainability and readability of the Code.
Java code annotation shortcut: ctrl + shift +/First familiarize
Copy codeThe Code is as follows: public class Test {
Public static void main (String [] args ){
// 1. Shift left (// 0000 0000 0000 0000 0000 0000 0000 0101 then shifted left after 2 places, low fill 0 ://
// 0000 0000 0000 0000 0000 0000 0001 0100
GridBagLayout is one of the most important layout managers in java. It can be said that GridBagLayout must be well learned,
GridBagLayoutA class is a flexible layout manager that can align components vertically, horizontally, or along their
Java reflection Learning
Reflection can be understood as an operation to obtain object type information during runtime. Traditional programming methods require programmers to determine the type used during the compilation phase. However, with the
String: String type
1. Constructor
Copy codeThe Code is as follows: String (byte [] bytes): constructs a String object through the byte array.
String (char [] value): constructs a String object using a char array.
String (Sting original):
In the java project development process, using the properties file as the configuration is basically essential, many such as system configuration information, File Upload configuration information, and so on are saved in this way.Learning to operate
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