- 浏览: 136710 次
- 性别:
- 来自: 上海
-
文章分类
最新评论
-
qq466862016:
不错的文章
JDK动态代理与CGLIB代理的对比 -
jinxiongyi:
你好,jpedal pdf转换图片的 画质,怎么提高。。我转 ...
介绍几款PDF转图片的开源工具 -
qqdwll:
转图片消耗的内存还是不小。 有时间得找找有没有更好的办法, 把 ...
介绍几款PDF转图片的开源工具 -
xiaoyao3857:
Thanks for your work!It's help ...
Keeping Eclipse running clean (转载) -
iceside:
图片讲解非常详细,说清了引用复制是怎么回事
Java 值传递的终极解释
<转载> 5 things you didn't know about ... the Java Collections API, Part 2
- 博客分类:
- Java
原文来自: http://www.ibm.com/developerworks/java/library/j-5things3.html
The Collections classes in java.util were designed to help, namely by replacing arrays and, thus, improving Java performance. As you learned in the previous article, they're also malleable, willing to be customized and extended in all kinds of ways, in service of good, clean code.
Collections are also powerful, however, and mutable: use them with care and abuse them at your own risk.
1. Lists aren't the same as arrays
Java developers frequently make the mistake of assuming that ArrayList is simply a replacement for the Java array. Collections are backed by arrays, which leads to good performance when looking up items randomly within a collection. And, like arrays, collections use integer-ordinals to obtain particular items. Still, a collection isn't a drop-in replacement for an array.
The trick to differentiating collections from arrays is knowing the difference between order and position. For example, List is an interface that preserves the order in which items are placed into a collection, as Listing 1 shows:
Listing 1. Mutable keys
import java.util.*;
public class OrderAndPosition
{
public static <T> void dumpArray(T[] array)
{
System.out.println("=============");
for (int i=0; i<array.length; i++)
System.out.println("Position " + i + ": " + array[i]);
}
public static <T> void dumpList(List<T> list)
{
System.out.println("=============");
for (int i=0; i<list.size(); i++)
System.out.println("Ordinal " + i + ": " + list.get(i));
}
public static void main(String[] args)
{
List<String> argList = new ArrayList<String>(Arrays.asList(args));
//注意这里的值传递和引用传递。 new ArrayList 会产生一个新的值。 这里相当于深度copy
//List<String> argList = Arrays.asList(args);
dumpArray(args);
args[1] = null;
dumpArray(args);
dumpList(argList);
argList.remove(1);
dumpList(argList);
}
}
Note:
When the third element is removed from the above List, the other items "behind" it slide up to fill the empty slots. Clearly, this collections behavior differs from that of an array. (In fact, removing an item from an array is itself not quite the same thing as removing it from a List — "removing" an item from an array means overwriting its index slot with a new reference or null.)
2. Iterator, you surprise me!
There's no doubt that Java developers love the Java Collections Iterator, but when was the last time you really looked at the Iterator interface? Most of the time, we just slap Iterator inside a for() loop or enhanced for() loop and move on, so to speak.
But, for those who go digging, Iterator has two surprises in store.
First, Iterator supports the ability to remove an object from a source collection safely, by calling remove() on the Iterator itself. The point here is to avoid a ConcurrentModifiedException, which signals precisely what its name implies: that a collection was modified while an Iterator was open against it. Some collections will let you get away with removing or adding elements to a Collection while iterating across it, but calling remove() on the Iterator is a safer practice.
Second, Iterator supports a derived (and arguably more powerful) cousin. ListIterator, only available from Lists, supports both adding and removing from a List during iteration, as well as bidirectional scrolling through Lists.
Bidirectional scrolling can be particularly powerful for scenarios such as the ubiquitous "sliding set of results," showing 10 of many results retrieved from a database or other collection. It can also be used to "walk backwards" through a collection or list, rather than trying to do everything from the front. Dropping in a ListIterator is much easier than using downward-counting integer parameters to List.get() to "walk backwards" through a List.
3. Not all Iterables come from collections
Ruby and Groovy developers like to brag about how they can iterate across a text file and print its contents to the console with a single line of code. Most of the time, they say, doing the same thing in Java programming takes dozens of lines of code: open a FileReader, then a BufferedReader, then create a while() loop to call getLine() until it comes back null. And, of course, you have to do all this in a try/catch/finally block that will handle exceptions and close the file handle when finished.
It may seem like a silly and pedantic argument, but it does have some merit.
What they (and quite a few Java developers) don't know is that not all Iterables have to come from collections. Instead, an Iterable can create an Iterator that knows how to manufacture the next element out of thin air, rather than blindly handing it back from a pre-existing Collection:
Listing 2. Iterating a file
// FileUtils.java
import java.io.*;
import java.util.*;
public class FileUtils
{
public static Iterable<String> readlines(String filename)
throws IOException
{
final FileReader fr = new FileReader(filename);
final BufferedReader br = new BufferedReader(fr);
return new Iterable<String>() {
public <code>Iterator</code><String> iterator() {
return new <code>Iterator</code><String>() {
public boolean hasNext() {
return line != null;
}
public String next() {
String retval = line;
line = getLine();
return retval;
}
public void remove() {
throw new UnsupportedOperationException();
}
String getLine() {
String line = null;
try {
line = br.readLine();
}
catch (IOException ioEx) {
line = null;
}
return line;
}
String line = getLine();
};
}
};
}
}
//DumpApp.java
import java.util.*;
public class DumpApp
{
public static void main(String[] args)
throws Exception
{
for (String line : FileUtils.readlines(args[0]))
System.out.println(line);
}
}
This approach has the advantage of not holding the entire contents of a file in memory, but with the caveat that, as written, it doesn't close() the underlying file handle. (You could fix this by closing whenever readLine() returns null, but that won't solve cases where Iterator doesn't run to completion.)
4. Beware the mutable hashCode()
Map is a wonderful collection, bringing us the niftiness of key/value pair collections often found in other languages like Perl. And the JDK gives us a great Map implementation in the form of the HashMap, which uses hashtables internally to support fast key lookups for corresponding values. But therein lies a subtle problem: Keys that support hash codes dependent on the contents of mutable fields are vulnerable to a bug that will drive even the most patient Java developer batty.
Assuming the Person object in Listing 3 has a typical hashCode() (which uses the firstName, lastName, and age fields — all non-final — to calculate the hashCode()), the get() call to Map will fail and return null:
Listing 3. Mutable hashCode() drives me buggy
// Person.java
import java.util.*;
public class Person
implements Iterable<Person>
{
public Person(String fn, String ln, int a, Person... kids)
{
this.firstName = fn; this.lastName = ln; this.age = a;
for (Person kid : kids)
children.add(kid);
}
// ...
public void setFirstName(String value) { this.firstName = value; }
public void setLastName(String value) { this.lastName = value; }
public void setAge(int value) { this.age = value; }
public int hashCode() {
return firstName.hashCode() & lastName.hashCode() & age;
}
// ...
private String firstName;
private String lastName;
private int age;
private List<Person> children = new ArrayList<Person>();
}
// MissingHash.java
import java.util.*;
public class MissingHash
{
public static void main(String[] args)
{
Person p1 = new Person("Ted", "Neward", 39);
Person p2 = new Person("Charlotte", "Neward", 38);
System.out.println(p1.hashCode());
Map<Person, Person> map = new HashMap<Person, Person>();
map.put(p1, p2);
p1.setLastName("Finkelstein");
System.out.println(p1.hashCode());
System.out.println(map.get(p1));
}
}
Clearly, this approach is a pain but the solution is easy: Never use a mutable object type as a key in a HashMap.
5. equals() vs Comparable
When cruising through the Javadocs, Java developers frequently happen across the SortedSet type (and its lone implementation in the JDK, the TreeSet). Because SortedSet is the only Collection in the java.util package that offers any sorting behavior, developers often begin using it without questioning the details too closely. Listing 4 demonstrates:
Listing 4. SortedSet, I'm so glad I found you!
import java.util.*;
public class UsingSortedSet
{
public static void main(String[] args)
{
List<Person> persons = Arrays.asList(
new Person("Ted", "Neward", 39),
new Person("Ron", "Reynolds", 39),
new Person("Charlotte", "Neward", 38),
new Person("Matthew", "McCullough", 18)
);
SortedSet ss = new TreeSet(new Comparator<Person>() {
public int compare(Person lhs, Person rhs) {
return lhs.getLastName().compareTo(rhs.getLastName());
}
});
ss.addAll(perons);
System.out.println(ss);
}
}
After working with this code for a while, you might discover one of the Set's core features: that it disallows duplicates. This feature is actually described in the Set Javadoc. A Set is a "collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element."
But this doesn't actually seem to be the case — although none of the Person objects in Listing 4 are equal (according to the equals() implementation on Person), only three objects are present within the TreeSet when printed.
Contrary to the stated nature of the set, the TreeSet, which requires objects to either implement Comparable directly or have a Comparator passed in at the time of construction, doesn't use equals() to compare the objects; it uses the compare or compareTo methods of Comparator/Comparable.
So, objects stored in a Set will have two potential means of determining equality: the expected equals() method and the Comparable/Comparator method, depending on the context of who is asking.
What's worse, it isn't sufficient to simply declare that the two should be identical, because comparison for the purpose of sorting isn't the same as comparison for the purpose of equality: It may be perfectly acceptable to consider two Persons equal when sorting by last name, but not equal in terms of their contents.
Always ensure that the difference between equals() and the Comparable.compareTo()-returning-0 is clear when implementing Set. By extension, the difference should also be clear in your documentation.
In conclusion
The Java Collections library is scattered with tidbits that can make your life much easier and more productive, if only you know about them. Unearthing tidbits often involves some complexity, however, like discovering that you can have your way with HashMap, just as long as you never use a mutable object type as its key.
So far, we've dug beneath the surface of Collections, but we haven't yet hit the gold mine: Concurrent Collections, introduced in Java 5. The next five tips in this series will focus on java.util.concurrent.
The Collections classes in java.util were designed to help, namely by replacing arrays and, thus, improving Java performance. As you learned in the previous article, they're also malleable, willing to be customized and extended in all kinds of ways, in service of good, clean code.
Collections are also powerful, however, and mutable: use them with care and abuse them at your own risk.
1. Lists aren't the same as arrays
Java developers frequently make the mistake of assuming that ArrayList is simply a replacement for the Java array. Collections are backed by arrays, which leads to good performance when looking up items randomly within a collection. And, like arrays, collections use integer-ordinals to obtain particular items. Still, a collection isn't a drop-in replacement for an array.
The trick to differentiating collections from arrays is knowing the difference between order and position. For example, List is an interface that preserves the order in which items are placed into a collection, as Listing 1 shows:
Listing 1. Mutable keys
import java.util.*;
public class OrderAndPosition
{
public static <T> void dumpArray(T[] array)
{
System.out.println("=============");
for (int i=0; i<array.length; i++)
System.out.println("Position " + i + ": " + array[i]);
}
public static <T> void dumpList(List<T> list)
{
System.out.println("=============");
for (int i=0; i<list.size(); i++)
System.out.println("Ordinal " + i + ": " + list.get(i));
}
public static void main(String[] args)
{
List<String> argList = new ArrayList<String>(Arrays.asList(args));
//注意这里的值传递和引用传递。 new ArrayList 会产生一个新的值。 这里相当于深度copy
//List<String> argList = Arrays.asList(args);
dumpArray(args);
args[1] = null;
dumpArray(args);
dumpList(argList);
argList.remove(1);
dumpList(argList);
}
}
Note:
When the third element is removed from the above List, the other items "behind" it slide up to fill the empty slots. Clearly, this collections behavior differs from that of an array. (In fact, removing an item from an array is itself not quite the same thing as removing it from a List — "removing" an item from an array means overwriting its index slot with a new reference or null.)
2. Iterator, you surprise me!
There's no doubt that Java developers love the Java Collections Iterator, but when was the last time you really looked at the Iterator interface? Most of the time, we just slap Iterator inside a for() loop or enhanced for() loop and move on, so to speak.
But, for those who go digging, Iterator has two surprises in store.
First, Iterator supports the ability to remove an object from a source collection safely, by calling remove() on the Iterator itself. The point here is to avoid a ConcurrentModifiedException, which signals precisely what its name implies: that a collection was modified while an Iterator was open against it. Some collections will let you get away with removing or adding elements to a Collection while iterating across it, but calling remove() on the Iterator is a safer practice.
Second, Iterator supports a derived (and arguably more powerful) cousin. ListIterator, only available from Lists, supports both adding and removing from a List during iteration, as well as bidirectional scrolling through Lists.
Bidirectional scrolling can be particularly powerful for scenarios such as the ubiquitous "sliding set of results," showing 10 of many results retrieved from a database or other collection. It can also be used to "walk backwards" through a collection or list, rather than trying to do everything from the front. Dropping in a ListIterator is much easier than using downward-counting integer parameters to List.get() to "walk backwards" through a List.
3. Not all Iterables come from collections
Ruby and Groovy developers like to brag about how they can iterate across a text file and print its contents to the console with a single line of code. Most of the time, they say, doing the same thing in Java programming takes dozens of lines of code: open a FileReader, then a BufferedReader, then create a while() loop to call getLine() until it comes back null. And, of course, you have to do all this in a try/catch/finally block that will handle exceptions and close the file handle when finished.
It may seem like a silly and pedantic argument, but it does have some merit.
What they (and quite a few Java developers) don't know is that not all Iterables have to come from collections. Instead, an Iterable can create an Iterator that knows how to manufacture the next element out of thin air, rather than blindly handing it back from a pre-existing Collection:
Listing 2. Iterating a file
// FileUtils.java
import java.io.*;
import java.util.*;
public class FileUtils
{
public static Iterable<String> readlines(String filename)
throws IOException
{
final FileReader fr = new FileReader(filename);
final BufferedReader br = new BufferedReader(fr);
return new Iterable<String>() {
public <code>Iterator</code><String> iterator() {
return new <code>Iterator</code><String>() {
public boolean hasNext() {
return line != null;
}
public String next() {
String retval = line;
line = getLine();
return retval;
}
public void remove() {
throw new UnsupportedOperationException();
}
String getLine() {
String line = null;
try {
line = br.readLine();
}
catch (IOException ioEx) {
line = null;
}
return line;
}
String line = getLine();
};
}
};
}
}
//DumpApp.java
import java.util.*;
public class DumpApp
{
public static void main(String[] args)
throws Exception
{
for (String line : FileUtils.readlines(args[0]))
System.out.println(line);
}
}
This approach has the advantage of not holding the entire contents of a file in memory, but with the caveat that, as written, it doesn't close() the underlying file handle. (You could fix this by closing whenever readLine() returns null, but that won't solve cases where Iterator doesn't run to completion.)
4. Beware the mutable hashCode()
Map is a wonderful collection, bringing us the niftiness of key/value pair collections often found in other languages like Perl. And the JDK gives us a great Map implementation in the form of the HashMap, which uses hashtables internally to support fast key lookups for corresponding values. But therein lies a subtle problem: Keys that support hash codes dependent on the contents of mutable fields are vulnerable to a bug that will drive even the most patient Java developer batty.
Assuming the Person object in Listing 3 has a typical hashCode() (which uses the firstName, lastName, and age fields — all non-final — to calculate the hashCode()), the get() call to Map will fail and return null:
Listing 3. Mutable hashCode() drives me buggy
// Person.java
import java.util.*;
public class Person
implements Iterable<Person>
{
public Person(String fn, String ln, int a, Person... kids)
{
this.firstName = fn; this.lastName = ln; this.age = a;
for (Person kid : kids)
children.add(kid);
}
// ...
public void setFirstName(String value) { this.firstName = value; }
public void setLastName(String value) { this.lastName = value; }
public void setAge(int value) { this.age = value; }
public int hashCode() {
return firstName.hashCode() & lastName.hashCode() & age;
}
// ...
private String firstName;
private String lastName;
private int age;
private List<Person> children = new ArrayList<Person>();
}
// MissingHash.java
import java.util.*;
public class MissingHash
{
public static void main(String[] args)
{
Person p1 = new Person("Ted", "Neward", 39);
Person p2 = new Person("Charlotte", "Neward", 38);
System.out.println(p1.hashCode());
Map<Person, Person> map = new HashMap<Person, Person>();
map.put(p1, p2);
p1.setLastName("Finkelstein");
System.out.println(p1.hashCode());
System.out.println(map.get(p1));
}
}
Clearly, this approach is a pain but the solution is easy: Never use a mutable object type as a key in a HashMap.
5. equals() vs Comparable
When cruising through the Javadocs, Java developers frequently happen across the SortedSet type (and its lone implementation in the JDK, the TreeSet). Because SortedSet is the only Collection in the java.util package that offers any sorting behavior, developers often begin using it without questioning the details too closely. Listing 4 demonstrates:
Listing 4. SortedSet, I'm so glad I found you!
import java.util.*;
public class UsingSortedSet
{
public static void main(String[] args)
{
List<Person> persons = Arrays.asList(
new Person("Ted", "Neward", 39),
new Person("Ron", "Reynolds", 39),
new Person("Charlotte", "Neward", 38),
new Person("Matthew", "McCullough", 18)
);
SortedSet ss = new TreeSet(new Comparator<Person>() {
public int compare(Person lhs, Person rhs) {
return lhs.getLastName().compareTo(rhs.getLastName());
}
});
ss.addAll(perons);
System.out.println(ss);
}
}
After working with this code for a while, you might discover one of the Set's core features: that it disallows duplicates. This feature is actually described in the Set Javadoc. A Set is a "collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element."
But this doesn't actually seem to be the case — although none of the Person objects in Listing 4 are equal (according to the equals() implementation on Person), only three objects are present within the TreeSet when printed.
Contrary to the stated nature of the set, the TreeSet, which requires objects to either implement Comparable directly or have a Comparator passed in at the time of construction, doesn't use equals() to compare the objects; it uses the compare or compareTo methods of Comparator/Comparable.
So, objects stored in a Set will have two potential means of determining equality: the expected equals() method and the Comparable/Comparator method, depending on the context of who is asking.
What's worse, it isn't sufficient to simply declare that the two should be identical, because comparison for the purpose of sorting isn't the same as comparison for the purpose of equality: It may be perfectly acceptable to consider two Persons equal when sorting by last name, but not equal in terms of their contents.
Always ensure that the difference between equals() and the Comparable.compareTo()-returning-0 is clear when implementing Set. By extension, the difference should also be clear in your documentation.
In conclusion
The Java Collections library is scattered with tidbits that can make your life much easier and more productive, if only you know about them. Unearthing tidbits often involves some complexity, however, like discovering that you can have your way with HashMap, just as long as you never use a mutable object type as its key.
So far, we've dug beneath the surface of Collections, but we haven't yet hit the gold mine: Concurrent Collections, introduced in Java 5. The next five tips in this series will focus on java.util.concurrent.
发表评论
-
介绍几款PDF转图片的开源工具
2011-09-09 00:40 4607最近项目中有个需求需要把PDF转成一张图。经过调查,有 ... -
jadclipse(反编译Eclipse插件)
2011-07-19 19:13 1665Jad Java decompiler plugin for ... -
Java开发时候的内存溢出
2011-07-13 17:33 1200这里以tomcat环境为例, ... -
class loader
2011-07-08 17:23 0Because Class.getResource() eve ... -
Jakarta-Common-BeanUtils使用笔记
2011-07-06 16:55 1403原文转发http://blog.csdn.net/fa ... -
基于MVC模式Struts框架研究
2011-04-13 20:02 1359不做web开发多年了, 可偶尔去面试的时候, 还是 ... -
Java反射与动态代理
2011-04-13 15:08 1021这篇文章是 成富 先生在InfoQ上Java 深度历险系列的一 ... -
Java枚举类型
2011-04-04 19:50 796Tiger中的一个重要新特性是枚举构造,它是一种新的Java枚 ... -
Java 值传递的终极解释
2011-03-21 22:49 1984对于Java的值传递, 你真的了解么? Ja ... -
六种异常处理的陋习
2011-03-20 03:21 839你觉得自己是一个Java专 ... -
数组初始化
2011-03-20 02:40 897数组初始化,你觉得简单吗? a.如果你觉得简单,那请看下面的 ... -
Java 实现 hashCode 方法
2011-03-11 17:07 1219原文 http://www.javapractices.com ... -
Java 中 immutable class 以及怎样实现immutable 类
2011-03-11 16:47 1374原文 http://www.javapractices.com ... -
Java 内部类介绍
2011-02-16 17:14 1012转载: http://zhidao.baidu.com/que ... -
Java 中的Clone 学习总结
2011-01-25 18:22 27901. 一个类需要实现clone. 一个最佳实践是它需要实现 C ... -
java 通过流, nio 移动文件或者文件夹
2011-01-04 17:54 1896我们用例子说明java怎样通过不同的方式移动文件或文件夹。 ... -
转 深入探讨SOAP、RPC和RMI
2010-12-17 00:34 1083这篇文章是从网上转下来的。 原文应该是写于2001年。 10 ... -
java 6 中的性能优化
2010-12-07 15:30 1451文章转载自: http://www ... -
创建强健,稳定的 JMS 系统
2010-12-07 15:21 991The most reliable way to produc ... -
Java Modifier Summary
2010-11-12 15:10 900<tbody> <tr> ...
相关推荐
`List<T>`是.NET框架中的一个类,位于`System.Collections.Generic`命名空间下。这里的`T`代表一个类型参数,允许我们创建一个可以存储特定类型对象的列表。例如,我们可以创建一个存储整数的`List<int>`或存储字符...
chain-1.2-bin.zip<br>commons-chain-1.2-src.zip<br>commons-cli-1.1-src.zip<br>commons-cli-1.1.zip<br>commons-codec-1.3-src.zip<br>commons-codec-1.3.zip<br>commons-collections-3.2.1-bin.zip<br>commons-...
<artifactId>commons-collections4</artifactId> <version>4.1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.17</version> </...
collections-2.1.1.jar<br>commons-logging-1.0.4.jar<br>dom4j-1.6.1.jar<br>ehcache-1.1.jar<br>hibernate3.jar<br>jaas.jar<br>jaxen-1.1-beta-7.jar<br>jdbc2_0-stdext.jar<br>jta.jar<br>log4j-1.2.11.jar<br>...
2.0.rc2.jar<br>jaxen-full.jar<br>jaxp-api.jar<br>jdbc2_0-stdext.jar<br>jstl.jar<br>mail.jar<br>mysql-connector-java-5.0.4-bin.jar<br>sax.jar<br>saxpath.jar<br>standard.jar<br>xalan.jar<br>xercesImpl....
update_wtl.zip<br>Notes on updating your WTL installation(2KB)<END><br>27,sidebarmenu.zip<br>An article about changing the look of WTL icon menu(85KB)<END><br>28,customdraw.zip<br>How to use WTL to ...
31.zip<br>Novell Netware Send<br>Netware网络间的信息发送(4KB)<END><br>109,32.zip<br>Winsock API Wrapper Classes<br>Winsock API包装类(5KB)<END><br>110,33.zip<br>ISAPI authentication filter<br>ISAPI身份...
<br> Copyright <br> Praise for Visual Studio Tools for Office <br> Microsoft .NET Development Series <br> Titles in the Series <br> About the Authors <br> Foreword <br> Preface <br> Acknowledgments ...
其中包含:shale-core.jar<br>commons-beanutils.jar<br>commons-chain.jar<br>commons-codec.jar<br>commons-collections.jar<br>commons-digester.jar<br>commons-el.jar<br>commons-fileupload.jar<br>commons-...
public static List<T> XmlToList<T>(string xmlFilePath) where T : new() { var list = new List<T>(); XmlDocument doc = new XmlDocument(); doc.Load(xmlFilePath); using (XmlNodeReader reader = new ...
`List<T>`是.NET Framework中`System.Collections.Generic`命名空间下的一个泛型集合类,它实现了`IList<T>`、`ICollection<T>`和`IEnumerable<T>`接口。`List<T>`是用于存储强类型对象的动态数组,允许快速的插入和...
### 关于 Java Collections API 您不知道的 5 件事 #### 1. Collections 比数组更好 在 Java 的早期阶段,为了回应 C++ 开发者对于性能的批评,Java 引入了数组这一概念。然而,随着时间的发展,Java 的 ...
<br> Copyright <br> Praise for Visual Studio Tools for Office <br> Microsoft .NET Development Series <br> Titles in the Series <br> About the Authors <br> Foreword <br> Preface <br> Acknowledgments ...
目录<br><br>前言<br>1. 翻译说明<br>1. 在Tomcat中快速上手<br>1.1. 开始Hibernate之旅<br>1.2. 第一个可持久化类<br>1.3. 映射cat<br>1.4. 与猫同乐<br>1.5. 结语<br>2. 体系结构<br>2.1. 总览<br>2.2. JMX集成<br...
Pro Java Programming,<br>Second Edition<br>BRETT SPELL<br><br>■CHAPTER 1 Going Inside Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br>■CHAPTER 2...
目录<br><br>前言<br>1. 翻译说明<br>1. 在Tomcat中快速上手<br>1.1. 开始Hibernate之旅<br>1.2. 第一个可持久化类<br>1.3. 映射cat<br>1.4. 与猫同乐<br>1.5. 结语<br>2. 体系结构<br>2.1. 总览<br>2.2. JMX集成<br...
For other references, see "Further Reading" on page 755.<br><br>This fourth edition provides integrated coverage of the Java programming language as provided by the Java™ 2 Platform Standard Edition...
5. commons-collections4-4.4.jar:Apache Commons Collections库,提供了对Java集合框架的增强功能,可能在处理数据时被用到。 6. fastjson-1.2.62.jar:Fastjson是阿里巴巴的一个高性能的JSON库,可以用于JSON和...
<br>using System.Collections.Generic;<br>using System.Text;<br>using System.Data;<br>using System.Data.SqlClient;<br> <br>namespace DatabaseOperate<br>{<br> class SqlOperateInfo<br> {<br> //Suppose ...
英文版<br>===================================================<br> Pro LINQ: Language Integrated Query in C# 2008 (c) by Apress<br><br> The type of the release is: eBook<br> In the PDF format with ISBN...