The Java rules described in this article are divided into 3 main levels, this article abandoned the peacetime development of the situation rarely encountered, those who use less later in the high-level chapter appears. And there are six useful
Writing high-quality code: 151 suggestions for improving Java programs (Chapter 1: String ___ suggestion 56 ~ 59), java151Suggestion 56: freely select the String concatenation Method
There are three methods to concatenate a string: the plus sign,
There are many sorting algorithms in C and C ++, but usually the sorting algorithm has to put programmers into an understanding of many pointers and positions at the underlying layer during code writing. Java does not want this, therefore, most
Collectionfirst, the concept of a collectionwritten Explanation: A collection is a simple object that contains more than one object, and the contained object is called an element. A collection can contain any number of objects, the quantity can vary,
First look at these three interfaces: List, set, map
Implementation classes: arraylist, rule list, treeset, hashset, hashmap, treemap, and hashtable
For the inheritance relationship of Java Collection classes, see:Java Collection
CollectionFirst, the concept of a collectionPersonal understanding: Saying simple points is similar, but far more powerful than arrays. Arrays can only be fixed-length, single-type, and the set is the expansion of the array above, enlarge. A
Use of the Collections tool class Public classNewsImplementsComparable {Private intId//News Number PrivateString title;//News Headlines@Override PublicString toString () {return"News [number =" + ID + ", title =" + title + "]"; }
Recently, Bo Master to do the project needs to do a WAP version of the mobile phone address Book, the afternoon to organize the next idea, found that the user name how to sort ah? Product manager said to make and mobile phone directory similar to
The following can be directly used to run, you can also download the attachment package directly, the compiler can see the effect of running directly.
//objectsort
Package sort;
Import java.util.ArrayList;Import java.util.Collections;Import
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.