Basic data typesJava is the language of a strong data classThere are 8 basic data types, including:Integer 4 types Int (4 bytes) short (2 bytes) long (8 bytes) byte (1 bytes)The range and machine-independent lengths of integers in Java are certain, and do not cause integer overflow across platformsFloat type two double floatThe length of the double is twice times
Java learning notes 8 --- class static variables and static methods access and call methods, java learning notes
Static variables are also called class variables, static methods are also called class methods. They are collectively referred to as static members or class members. Static members are modified by static and belong to the entire class. All objects shar
[Java concurrent programming] 8. Various lock concepts, java concurrent programming
Updating...
Shared lock (S lock ):If transaction T adds A shared lock to data A, other transactions can only add A shared lock to data A, but cannot apply an exclusive lock until all shared locks are released. Transactions authorized to share locks can only read data and cannot
Java naming convention: The first letter lowercase, the first letter of the following word, the camel's name.Be aware of the label:typealiases> in the label properties> below.Four, mapper mapper :1) Resource way:1 "account.xml" />2) class mode:1 class="jd.com.proxydao.AccMapper" />Specification Requirements:1:mapper files and interfaces need to be under the same package.The name of the 2:mapper mapping file needs to be the same as the name of the int
Classes are loaded: Refers to reading the binary data of a class file into the runtime data area (the JVM is partitioned in memory)and creates a class object within the method area.Class Loader:Responsible for loading the compiled class file (bytecode file) into the JVM (Java Virtual machine).The class loader is mainly divided into the following types:1.Bootstrap class loader (boot class loader)Responsible for loading the
, the algorithm converts each character using 1-4-byte encoding.Code point/code unit (JDK 5.0)
A code point is a code value (Unicode encoding) that corresponds to a character in an encoded table.In Java, the char type describes a code unit with UTF-16 encoding.UTF-16 uses a different length of encoding to represent all Unicode code points . In the basic multilingual plane, each character is represented by 16 bits (often referred to as a unit of
[Java in-depth research] 8. Java's Unsafe class details, in-depth study of unsafe
Java cannot directly access the underlying operating system, but is accessed through local methods. The Unsafe class provides hardware-level atomic operations and mainly provides the following features:1. memory can be allocated through the Unsafe class and can be released;
Class Th
Original:http://it.deepinmind.com/java/2015/03/17/20-examples-of-date-and-time-api-from-Java8.htmlIn addition to lambda expressions, stream, and a few minor improvements, Java 8 introduces a new set of time and date APIs, and in this tutorial we will learn how to use this set of Java
Java Multithreading Core technology comb (with source code)
Java Multithreading Core Technology comb the source code written in front Java multithreaded objects and variables concurrent access between threads communication lock usage Timer single case mode and multithreadi
1. three main features of the process:Independence: With its own independent address space, a process cannot directly access the address space of other processes.Dynamic: is a collection of instructions that are active in a system.Concurrency: A single process can be performed concurrently on multiple processors, with no impact on each other.2. Differences in concurrency and parallelism:Parallel is the same time, there are multiple instructions on multiple processors at the same time, concurrenc
Merge stream/Sequential stream (Sequenceinputstream):is to combine multiple input streams into a single Stream object.1 Public classSequenceinputstreamdemo {2 Public Static voidMain (string[] args)throwsException {3 //To create a sequential stream object4Sequenceinputstream in =NewSequenceinputstream (NewFileInputStream ("Stream.txt"),5 NewFileInputStream ("Stream2.txt"));6 7 byte[] buffer =New byte[1024];8
Memory Stream (Array stream):The data is temporarily present in the array and will be retrieved from the array later.1. Byte memory stream: Bytearrayinputstream/bytearrayoutputstream2. Character Memory stream: Chararrayinputstream/chararrayoutputstream3. String stream: Stringreader/stringwriter (storing data in an array)BYTE memory stream: Public classBytearraydemo { Public Static voidMain (java.lang.string[] args)throwsException {//byte array output stream: program-to-memoryBytearrayoutputstrea
JSTL Core Tag Library has a total of 13 tags, functionally divided into 4 categories:
1. Expression control Tags: out, set, remove, catch
2. Process Control Tag: If, choose, when, otherwise
3. Cyclic Tags: forEach, fortokens
4.URL operation tag: import, URL, redirect
When using labels, be sure to include the following code in the header of the JSP file:
These labels are described in the following sections:
1.
the implementation of the interface class to realize the replacement system.Definition of the interface:1. The naming conventions and classes of the interfaces are the same.Example: public interface interface Name {}2. Constants can be defined in the interface, and variables cannot be defined. The properties in the interface are automatically modified with public static final. The constants in the interface must specify the initial values when they are defined.3. The methods involved in the int
thread is an object in Java, what are the properties of this object? Thread properties can be divided into static and dynamic properties, static here refers to the programmer is immutable, there is a JVM allocation, dynamic refers to the programmer can be customized, although the JVM gave the default property values. Static attributes: ID, etc., Dynamic properties: Name,priority,deamon,group,classloader, etc. So much for the basics, that's what it's
,testj8functionalinterface2::customedfunc); }publicvoidcustomedfunc () { system.out.println ("acustomedmethodreference."); }publicvoIdtest (Intx,funcfunc) { SYSTEM.OUT.PRINTLN (x); func.run (); }}The above example lists a lambda pattern and a method reference pattern, so that you can take advantage of the powerful ability of functional programming to use the method as a parameter.To read the full text, please click: http://click.aliyun.com/m/9152/This article is from the "12466150" blog, please
child class is placed in the parent class object, and only methods of the parent class can be called. 1 Employee empl = new Manager () 2 Empl.setbonus (100); // compile error, no Setbonus method in parent class 3 4 // You can convert a parent class reference to a subclass reference 5 if (empl instanceof Manager) { Span style= "color: #008080;" >6 Manager Mgr = (manager) Empl; 7 Mgr.setbonus (100 8 } When a method is declared final,
pointer exception when the value is unboxing if the key does not exist get returns nullint count = Counts.getordefault ("A", 0);//Recommended UseThe counter, when present, adds one:Counts.merge (Word, 1, integer::sum);If the word key does not exist before, connect Word with 1, or use the Integer::sum function to add 1 to the previous valueP243 Map Method! I didn't read it.1 // Iteration Map 2 for (map.entry entry:counts.entrySet ()) {3 String k = entry.getkey (); 4 Integer V = entry.getval
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.