
Java
文章平均质量分 69
Abner_Niu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HashMap vs. TreeMap vs. Hashtable vs. LinkedHashMap
原文 HashMap vs. TreeMap vs. Hashtable vs. LinkedHashMap翻译 2014-04-12 22:21:32 · 688 阅读 · 0 评论 -
Java Reflection - Fields
http://tutorials.jenkov.com/java-reflection/fields.html Using Java Reflection you can inspect the fields (member variables) of classes and get / set them at runtime. This is done via the Java转载 2015-05-31 11:51:29 · 375 阅读 · 0 评论 -
Java Reflection - Constructors
http://tutorials.jenkov.com/java-reflection/constructors.html Using Java Reflection you can inspect the constructors of classes and instantiate objects at runtime. This is done via the Java c转载 2015-05-31 11:48:50 · 516 阅读 · 0 评论 -
Java Reflection - Methods
http://tutorials.jenkov.com/java-reflection/methods.html Using Java Reflection you can inspect the methods of classes and invoke them at runtime. This is done via the Java class java.lang.ref转载 2015-05-31 11:50:53 · 744 阅读 · 0 评论 -
Java Reflection - Dynamic Proxies
http://tutorials.jenkov.com/java-reflection/dynamic-proxies.html Using Java Reflection you create dynamic implementations of interfaces at runtime. You do so using the classjava.lang.reflect.转载 2015-05-31 11:54:55 · 464 阅读 · 0 评论 -
Java Reflection - Arrays
http://tutorials.jenkov.com/java-reflection/arrays.html Working with arrays in Java Reflection can be a bit tricky at times. Especially if you need to obtain the Class object for a certain ty转载 2015-05-31 11:55:43 · 359 阅读 · 0 评论 -
反射0-Java Reflection Tutorial
http://tutorials.jenkov.com/java-reflection/index.html Java Reflection makes it possible to inspect classes, interfaces, fields and methods at runtime, without knowing the names of the classes,转载 2015-05-31 11:46:58 · 355 阅读 · 0 评论 -
Java Reflection - Dynamic Class Loading and Reloading
http://tutorials.jenkov.com/java-reflection/dynamic-class-loading-reloading.html It is possible to load and reload classes at runtime in Java, though it is not as straightforward as one might转载 2015-05-31 11:55:46 · 862 阅读 · 0 评论 -
Java Reflection - Annotations
http://tutorials.jenkov.com/java-reflection/annotations.html Using Java Reflection you can access the annotations attached to Java classes at runtime. What are Java Annotations? Annotatio转载 2015-05-31 11:54:33 · 444 阅读 · 0 评论 -
Java Reflection - Getters and Setters
http://tutorials.jenkov.com/java-reflection/getters-setters.html Using Java Reflection you can inspect the methods of classes and invoke them at runtime. This can be used to detect what gette转载 2015-05-31 11:52:53 · 479 阅读 · 0 评论 -
Java数组
参考: http://www.w3cschool.cc/java/java-array.html http://www.blogjava.net/flysky19/articles/92763.html 一,基础 数组对于每一门编辑应语言来说都是重要的数据结构之一,当然不同语言对数组的实现及处理也不尽相同。 Java语言中提供的数组是用来存储固定大小的同类型元素。原创 2015-05-29 15:12:49 · 384 阅读 · 0 评论 -
java内部类
-----------2015.5.4------------ 为什么要使用内部类? 内部类可以实现独立的接口或者继承外部类没能继承的类,一定程度上解决单继承和实现接口无法实现的功能。使用内部类还可以隐藏信息,比如用外部类的一个public方法返回一个实现了某个接口的内部类的对象,别的类是不知道该对象是由哪个类创建的。 public class Test { public sta原创 2015-05-04 18:50:08 · 623 阅读 · 0 评论 -
java对象的强引用,软引用,弱引用和虚引用
原文 : http://blog.youkuaiyun.com/lengyuhong/article/details/6398184转载 2014-06-14 17:20:36 · 513 阅读 · 0 评论 -
JNI
深挖坑,广积粮原创 2014-03-05 17:33:52 · 505 阅读 · 0 评论 -
Java Reflection - Private Fields and Methods
http://tutorials.jenkov.com/java-reflection/private-fields-and-methods.html Despite the common belief it is actually possible to access private fields and methods of other classes via Java Re转载 2015-05-31 11:51:58 · 476 阅读 · 0 评论 -
Java Reflection - Classes
http://tutorials.jenkov.com/java-reflection/classes.html The Class ObjectClass NameModifiersPackage InfoSuperclassImplemented InterfacesConstructorsMethodsFieldsAnnotations Usi转载 2015-05-31 11:49:16 · 387 阅读 · 0 评论 -
嵌套类,内部类,匿名内部类再学习
内部类 在一个类内声明的类称为内部类。 内部类“隐式”地持有外部类的引用,所以可以访问外部类对象的成员,方法。 看下Oracle给的一个例子。 public class DataStructure { // Create an array private final static int SIZE = 15; private int[] arrayOfInts =原创 2015-08-20 18:19:22 · 569 阅读 · 0 评论 -
Java,Android内存泄漏代码片段
public class MemoryLeakDemo extends Activity implements NewworkCallBack{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /**原创 2015-08-19 18:17:05 · 653 阅读 · 0 评论 -
Android性能优化-内存
内存方面遇到的问题常有OOM,内存泄漏。实际上JVM的GC对性能的影响也很大。GC时正在运行的线程会暂停,如果此时正在执行动画,那就有可能导致跳帧,对用户来说,看到的就是动画卡顿。应该避免使JVM频繁地GC。 参考文章 Android性能优化之内存篇 。 内存泄漏是指仍然引用不再使用的对象,从而导致GC无法回收,导致可用内存减少,导致频繁GC,导致性能问题。 3种内存测量的原创 2015-08-18 09:08:20 · 626 阅读 · 0 评论 -
一道有关数据类型的笔试题
题目 There are 4 variables: short v1 = 18; Long v2 = new Long("18"); Long v3 = new Long(18); Short v4 = new Short(v1); Which of the following statements are true:原创 2015-08-14 14:29:52 · 829 阅读 · 0 评论 -
一道String拼接的考题
When doing string concatenation for many times in a loop, which is the fastest way in terms of executing time: A) The concat() method of String B) The + operator of String C) The append() method of原创 2015-08-14 12:09:40 · 1145 阅读 · 0 评论 -
java注解再学习
http://www.trinea.cn/android/java-annotation-android-open-source-analysis/ 不少开源库都用到了注解的方式来简化代码提高开发效率 本文简单介绍下 Annotation 示例、概念及作用、分类、自定义、解析,并对几个 Android 开源库 Annotation 原理进行简析。 一、Annotation 示例转载 2015-07-22 18:11:56 · 535 阅读 · 0 评论 -
Executor
public interface Executor { /** * Executes the given command at some time in the future. The command * may execute in a new thread, in a pooled thread, or in the calling * thread,原创 2015-07-16 17:22:59 · 439 阅读 · 0 评论 -
java并发1
Java Synchronized Blocks 同一对象上的synchronized代码块,同一时刻只允许一个线程进入,其他想进入的线程只能等待,直到之前的线程退出代码块。 有4中synchronized代码块 Instance methodsStatic methodsCode blocks inside instance methodsCode blocks inside转载 2015-07-06 18:07:29 · 579 阅读 · 0 评论 -
Java 并发0
http://tutorials.jenkov.com/java-concurrency/concurrency-models.html 单核-单任务-多任务 “并发”并不仅仅指多线程,还可以是多任务,分布式系统。 多线程的好处: 更好的系统资源利用;相近的设计;更好地响应速度。 多线程的代价: 复杂的设计;上下文切换开销;线程自身的资源消费。 并转载 2015-07-03 18:49:24 · 368 阅读 · 0 评论 -
@Override与方法的重写
@Override注解可以帮助检查父类中是否有该方法,但不加@Override,子类也可以复写父类的方法,且可以使用父类的引用调用该方法。 class A { public void sayInA(int p ){ System.out.println("In A:"+p); } public void sayInAA(int p ){原创 2015-06-15 10:34:38 · 670 阅读 · 0 评论 -
AtomicInteger 使用
使用Android Relativelayout动态添加child view时,设置id时,sdk 17提供了一个生成id的方法 private static final AtomicInteger sNextGeneratedId = new AtomicInteger(1); /** * Generate a value suitable for use in {@原创 2015-06-30 11:03:27 · 543 阅读 · 0 评论 -
Generic 泛型
参考 http://tutorials.jenkov.com/java-generics/methods.html 定义使用泛型的类 public class GenericFactory { Class theClass = null; public GenericFactory(Class aClass){ this.theClass = aCla转载 2015-06-01 15:12:08 · 418 阅读 · 0 评论 -
Java Reflection - Generics
http://tutorials.jenkov.com/java-reflection/generics.html I have often read in articles and forums that all Java Generics information is erased at compile time so that you cannot access any o转载 2015-05-31 11:55:11 · 432 阅读 · 0 评论 -
java环境搭建
JRE Java Runtime Environment,java运行环境,包含jvm,以及运行java程序的必需的核心类。 JDK Java Development Kit,java程序开发环境,包含了JRE。 (所谓”绿色版“软件就是无需安装,下载即可使用,放在u盘上也可以使用,重装系统也没有影响,相对而言需要安装的软件,需要向注册表写东西,重装系统后需要重新安装) 将javac原创 2015-05-10 22:06:43 · 506 阅读 · 0 评论 -
ArrayList vs. LinkedList vs. Vector
深挖坑,广积粮翻译 2014-03-05 17:13:45 · 560 阅读 · 0 评论 -
动态数组实现
源码中ArrayList,Vector就是用数组实现的,且是可变数组,看看是怎么实现的。 默认大小10个。 public ArrayList() { this(10); }添加元素时 public boolean add(E e) { ensureCapacityInternal(size + 1); // Increments mo原创 2015-05-10 10:27:32 · 501 阅读 · 0 评论 -
HashSet vs. TreeSet vs. LinkedHashSet
原文: HashSet vs. TreeSet vs. LinkedHashSet翻译 2014-04-12 20:17:43 · 801 阅读 · 0 评论 -
I/O 获取指定目录下的指定文件和目录
import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.regex.Pattern; public final class Directory { p原创 2014-04-11 14:51:55 · 453 阅读 · 0 评论 -
Application 和 Applet
Applet 是运行于kehud原创 2014-05-12 16:07:31 · 544 阅读 · 0 评论 -
Java数组在内存中是什么样的?
原文:http://blog.youkuaiyun.com/snarlfuture/article/details/19429871 Java中的数组主要保存两项内容:基本类型数据(int,char,...),引用(也可以认为是指针)。 每当使用“new”关键字创建一个新的对象,内存就会在堆中为其分配一块新的空间,并返回对这一空间的引用。对数组来说,也是一样的,因为数组也是对象转载 2014-04-21 17:14:04 · 741 阅读 · 0 评论 -
java static 学习
static可用来修饰class,原创 2014-04-21 12:20:31 · 641 阅读 · 0 评论 -
生成jar包(坑)
1,在eclipse下生成 2,在commond line原创 2014-05-05 12:51:55 · 814 阅读 · 0 评论 -
CLASSPATH
CLASSPATH原创 2014-05-03 21:41:57 · 991 阅读 · 0 评论 -
关于 java Heap Memory 你要知道的10点
原文:10 points about Java Heap Space or Java Heap Memory Read more: http://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html#ixzz30EiQFm6l翻译 2014-04-29 11:44:01 · 4763 阅读 · 0 评论