Java program performance optimization and java Performance Optimization
Java program tuning entry-level tutorials seem very thick. In fact, the book is very thin, domestic handwriting is high, of course there are some content suspected of plagiarism, suitable for
The previous LZ has fully introduced a lot of knowledge about the list interface, such as ArrayList, LinkedList, Vector, Stack, which can have a deeper understanding of the list interface through these knowledge points. Only by summarizing the knowledge is your knowledge. So the following LZ on the list interface to do a summary. Recommended reading:Java Improvem
list.What if the language is different? The Java. Text package provides the collector and collectionkey classes to sort languages. Here is an example:NOTE: If your text is in the local language rather than the default language, you need to pass a local language to the getinstance () method, just like:
Public static class collatorcomparatorImplements comparator {Collator = collator. getinstance ();Public int compare (Object el
Program Code Optimization Essentials:
String optimization: Parsing string source, understanding string common methods, using StringBuffer, StringBuilder.
List, Map, set Optimization: Analysis commonly used ArrayList, LinkedList, HashMap, TreeMap, Linkedhashmap, set interface, set common method optimization.
Using the nio:buffered, channel operation and principle, 0 copies are used.
Refe
sorting function calls an sort built-in function under the collection object. [very easy to use !]
1 // Collections. sort sorting 2 Collections. sort (number); 3 Collections. sort (word );
In this way, number and word are directly converted into a list in ascending order.
There is actually another way to sort by calling the compare function.
Complete program:
1 import
The following is a list of videos related to this book, which will be updated dynamicallyChapter I.1 Video 1.1 The differences between JDK and JRE and JVM, install Java Development Environment 1.1.1 2nd page2 Video 1.2 Writing the first HelloWorld program 1.1.2 2nd page3 video 1.3 Developing slightly complex programs with function calls 1.1.3 5th page4 Video 1.4D
The argument list sets out what information we send to the method. As you may have guessed, this information-as anything else in Java-takes the form of objects. Therefore, we must specify the type of object to pass in the argument list, and the name of each object. As we do with objects elsewhere in Java, we actually p
Forest Wood Blog Website: http://blog.csdn.net/wolinxuebinReference URL: http://blog.csdn.net/sunsaigang/article/details/5751780Description: The function of a simple single-linked list with Java implementationDefines a MyList classThe included functions:GetHead () returns the head pointer;IsEmpty () to determine whether it is empty;AddFirst (T Element) joins the element in the head of the linked
in Java that is used to operate arrays.Arrays has a set of static functions,Equals (): checks whether two arrays are equal. Array has the same number of elements, and all corresponding elements are equal to each other.Fill (): Enter the value in array.Sort (): used to sort arrays.Binarysearch (): Search for elements in the sorted array.System. arraycopy (): copying an array.
Ii. Collection and map
If you do not know how many objects are needed when w
1. collection list set map difference memory
These represent the set in Java. Here, we mainly analyze whether its elements are ordered and whether they can be repeat for different memory for proper use. Of course, there are still synchronization differences, see the previous article.
Ordered or not
Allow repeated Elements
Collection
No
Yes
"List Interface"Note: "Common Methods""Program Analysis"Note : Be aware of the difference between the Add method and the Set method. "Common Methods"Java.util.Collections provides some static methods to implement some common algorithms based on the list container. (This is not a collection interface, note the distinction)"Common Algorithm
, three shell scripts, instant resolution of everything. Those who create these things are really geniuses, and the people who use them may need endless learning.[Email protected] ~]$ Java-helpUsage:java [-options] class [args ...](to execute a class)or Java [-options]-jar jarfile [args ...](To execute a jar file)Where options include:-d32 use a 32-bit data model if available-d64 use a 64-bit data model if
OPENCV Component Structure About OpenCV's component structure "light ink" great God gave a detailed explanation, detailed reference: List of the mountains small: OpenCV 2.4.8 or OpenCV 2.4.9 component structure full analysis but in OpenCV3.1 still some changes in opencv/build/ All modules in the Include/opencv2 directory with OpenCV,Altogether there are so many modules, in the light ink of the article also made a detailed introduction, some modules h
For java program exception handling (Handout)-Linux general technology-Linux programming and kernel information, see the following for details. Lecture 16th: Exception Handling
16.1 introduction:
Exceptions are any errors or unexpected behaviors encountered during program execution.
Any of the following situations can cause exceptions: your code or called code (s
First, what is Jconsole?JConsole has been introduced from Java 5. JConsole is a built-in Java Performance Analyzer that can be run from the command line or in the GUI shell. You can easily monitor Java application performance and track code in Java using JConsole (or its more advanced "close relatives" VisualVM).Second
Tips"Effective Java, third Edition" an English version has been published, the second edition of this book presumably many people have read, known as one of the four major Java books, but the second edition of 2009 published, to now nearly 8 years, but with Java 6, 7, 8, and even 9 of the release, the Java language has
is not possible to determine how many elements are actually stored, and length simply tells us the capacity of the array.2,Java has a arrays class, specifically used to manipulate the array.The arrays has a set of static functions,Equals (): Compares two arrays for equality. Array has the same number of elements, and all corresponding element 22 is equal.Fill (): Fills the value into the array.Sort (): Used to sort the array.BinarySearch (): Looks fo
List mapping tableA list is an element that a Java collection stores in a sequence and allows repeating elements. Users of this interface can accurately control the insertion of each element in the list. Users can access elements through their integer index and search for elements in the
---I don't produce code, I just code the porter.In the Java util package there are two parent interfaces for all collections collection and map, their parent-child relationships: java.util +collection This interface extends from--java.lang.iterab Le interface +list interface -arraylist class N Bsp -linkedlist class -vector class nbsp This class is implemented in sync +que
1.Collection List Set Map differential memoryThese represent the collection in Java, where the main element is whether the elements are ordered, whether they can be repeated to distinguish between memory, in order to properly use, of course, there are synchronization differences, see the previous article related.
Ordered No
Allow elements to repeat no
Collection
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.