As long as Java knows the usage of the + + and-operator, as
int i = 1;
int j = i++;
int k = ++i;
Results I was 3,j to 1,k for 3.The following code:
Int J = 0;
for (int i = 0; i ; i++) {
J = j + +;
}
Anonymous inner class:1, the anonymous inner class is actually the shorthand format for the inner class.2, the premise of defining an anonymous inner class:The inner class must inherit a class or implement an interface.3, Anonymous inner class
Lombok is a very old project, also very practical, but strangely so for years seems to have been tepid. Many Lombok features can be referred to its official website, ha . brother Lian www.lampbrother.net here is just a brief introduction to its
First, the reason why we do this:1. Efficiency (most important)2. Readability, easy to post maintenance. (also very important)Second, the Code optimization requirements:1. Reduce the volume of the code.2. Improve the operation efficiency of the code.
Collection├list│├linkedlist│├arraylist│└vector│└stack└setMap├hashtable├hashmap└weakhashmapCollecti The on interface Collection is the most basic collection interface, and a collection represents a set of object, the collection element (Elements).
Threading ActionWhen a server requires a large number of concurrent connections, it is common to use lightweight threads to handle a large number of connections, rather than heavyweight processes. threads are more lenient on resource use because
a variety of different understandings1The main purpose of declaring a method or class as final is to make sure that they do not change the semantics in subclasses. The string class is the final class, which means that no one is allowed to define a
public static void Main (string[] args) {String S1 = new StringBuilder ("Computer"). Append ("Software"). toString ();//In the heapSystem.out.println (S1.intern () ==s1);//Intern Returns a value pointing to the heap "reference to computer software"
First on the code: Public classJavatest {Private intParaint = 10; Public intGetparaint () {returnParaint; } Public voidSetparaint (intparaint) { This. Paraint =Paraint; } Public voidTrychangebasicdata (intpara) {Para= 100;
About Stack Stack is a stack. Its characteristics are: Advanced post-Exit (FILO, first in the last out). The stack in the Java Toolkit is inherited from vectors (vector queues), since vectors are implemented by arrays, which means that stacks are
Import Java.util.linkedlist;import Java.util.list;import Java.util.concurrent.locks.condition;import Java.util.concurrent.locks.lock;import Java.util.concurrent.locks.reentrantlock;public class PC {private static Final lock lock = new Reentrantlock (
Large HashMap overview:jdk, Fastutil, Goldman Sachs, HPPC, Koloboke, trove-january version:a Quick overview of Al L Major Libraries implementing hashmaps.
Fastutil 6.6.0 turned out to be consistently fast. It may become even faster if it
One: Demand analysisTo generate a verification code using Java:1: Create a canvas and draw a good background image2: Draw Random numbers3: Draw the interfering line4: Save the In-memory picture to your hard diskTwo: The code is as follows1 /**2 * 3
The reason for the problem stems from a simple interview: The topic requires the following:Build three threads, a thread prints 10 times A, a thread prints 10 times b,c thread prints 10 times C, requires the thread to run concurrently, and prints 10
There are eight basic data types in Java, each of which isBYTE, short, int, long, float, double, char, BooleanIntegral typeWhere byte, short, int, long all represent integers, except that their range of values is not the sameByte has a value range
Spring Summary-IOC and Bean summary, spring summary iocbean
1. The overall structure of Spring in the official Spring document.
Ii. Overall structure of Spring as I understand it.
Iii. Summary of the core part of Spring
1. As shown in the figure
[Convert] spring_bean attributes, spring_bean attributes
1. parent
Indicates the inherited parent class.
If there are many beans that inherit the same parent class
In the configuration file, you can omit the attributes injected by the parent class
Java for and foreach Loops
The variable in the for loop condition is evaluated only once! Take a look at the final picture
The foreach statement is newly added to Java 5. When traversing arrays and sets, foreach has good performance.
Foreach
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