
Java
文章平均质量分 78
xzbaimildcat
这个作者很懒,什么都没留下…
展开
-
Object serialization
From Thinking in Java.Java's object serializationallows you to take any object that implements theSerializableinterface and turn it into a sequence of bytes that can later be fully restored转载 2013-03-11 13:09:56 · 483 阅读 · 0 评论 -
Java equals() and hashCode() Contract
http://www.programcreek.com/2011/07/java-equals-and-hashcode-contract/The Java super classjava.lang.Object has two very important methods defined:public boolean equals(Object obj)publi转载 2013-10-22 15:56:03 · 736 阅读 · 0 评论 -
How to make a java class immutable
An immutable class is one whose state can not be changedonce created. There are certain guidelines to create an class immutable. Inthis post, we will revisit these guidelines.Sections:Benefits转载 2013-10-21 21:59:18 · 912 阅读 · 0 评论 -
Working with hashCode and equals methods in java
In thispost, i will point out my understanding about hashCode() and equals() method. Iwill talk about their default implementation and how to correctly overridethem. I will also write about implemen转载 2013-10-21 19:23:50 · 739 阅读 · 0 评论 -
ReentrantLock
ReentrantLock in Java is added on java.util.concurrent package in Java 1.5along with other concurrentutilities like CountDownLatch, Executors and CyclicBarrier.ReentrantLock is one of the most转载 2013-10-19 21:15:54 · 668 阅读 · 0 评论 -
threadlocal
ThreadLocal in Java is another way to achieve thread-safety apart from writing immutable classes.If you have been writing multi-threaded or concurrent code in Java then you must be familiar with c转载 2013-10-19 20:19:11 · 392 阅读 · 0 评论 -
Java Annotations
Annotation is code about the code, that is metadata about the program itself. In other words, organized data about the code, embedded within the code itself. It can be parsed by the compiler, annotati转载 2013-10-25 10:24:56 · 582 阅读 · 0 评论 -
Annotations in JUnit
http://www.devmanuals.com/tutorials/java/JavaTestingTools/junit/AnnotationsInJUnit.htmlhttps://github.com/junit-team/junit/wiki/Getting-started Annotations are like meta-tags that you can add to转载 2013-10-24 19:10:38 · 695 阅读 · 0 评论 -
Difference between Comparator and Comparable in Java
简单说:实现Camparable接口可以直接使用sort方法Collections.sort(List list)排序实现Comparator接口的可以用Collections.sort(List list, Comparator c)排序一个类实现了Camparable接口则表明这个类的对象之间是可以相互比较的,这个类对象组成的集合就可以直接使用sort方法排序。Comp转载 2013-10-24 13:46:15 · 743 阅读 · 0 评论 -
java.lang.NullPointerException
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.NullPointerException public class NullPointerException extends RuntimeExceptionT转载 2013-06-22 19:59:04 · 509 阅读 · 0 评论 -
The instanceof Keyword
http://www.java2s.com/Tutorial/Java/0060__Operators/TheinstanceofKeyword.htmThe instanceof keyword can be used to test if an object is of a specified type.public class MainClass { public s转载 2013-06-23 02:09:00 · 474 阅读 · 0 评论 -
Java String Split Example
*2.Java String split example.3.This Java String split example describes how Java String is split into multiple4.Java String objects.5.*/6. 7.public class JavaStringSplitExample{8.转载 2013-06-21 06:00:42 · 813 阅读 · 0 评论 -
some links about learning java
Links to learn Java1. http://www.tutorialspoint.com/java/2. http://www.javabeginner.com/3. http://www.roseindia.net/javatutorials/4. http://docs.oracle.com/javase/1.5.0/docs/guide/language/ind原创 2013-02-03 21:05:30 · 298 阅读 · 0 评论 -
从 Java 程序调用 C/C++ 代码
http://www.ibm.com/developerworks/cn/education/java/j-jni/section2.html概述当无法用 Java 语言编写整个应用程序时,JNI 允许您使用本机代码。在下列典型情况下,您可能决定使用本机代码:希望用更低级、更快的编程语言去实现对时间有严格要求的代码。希望从 Java 程序访问旧代码或代码库。需要标准 Jav转载 2013-03-12 22:07:28 · 778 阅读 · 0 评论 -
Controlling serialization
the default serialization mechanism is trivial to use. But what if you have special needs? Perhaps you have special security issues and you don’t want to serialize portions of your object, or perhaps转载 2013-03-11 13:30:11 · 415 阅读 · 0 评论 -
java-file stream
the hierarchy of the file stream in java转载 2014-10-05 21:35:36 · 436 阅读 · 0 评论