![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
J2SE
iteye_18468
这个作者很懒,什么都没留下…
展开
-
面试题 - 刁钻
记录下 遇到的 一些 刁钻 面试题:[b]嘿嘿[/b] i++ & ++i & 基本类型 传值[code="java"]public class Test { public static void main(String[] args) { int i = 0; Test t = new Test(); t.increase(i); i = i++;...2010-08-28 11:34:53 · 115 阅读 · 0 评论 -
Scan classes with specified annotation under specified package
Scan classes with specified annotation under specified package. steps:* define annotation* use annotation on class* get class set with specified annotations under specified packages, ...2014-08-05 13:41:03 · 186 阅读 · 0 评论 -
http - simple server & client
Simple http server & client implementation by pure j2se. http - client:package eric.j2se.net.http;import java.io.IOException;import java.io.InputStreamReader;import java.io.LineNumb...2014-01-10 11:53:10 · 133 阅读 · 0 评论 -
Java proxy
Java proxy proxy, a design pattern base on reflect, it handle method invocation on object with a proxy instance, ------class & interface include:* java.lang.reflect.Proxy help to...2012-12-07 18:14:24 · 123 阅读 · 0 评论 -
Java lock & condition
java Lock & Condition, provide a similar, yet more extensive locking mechanism than synchronized, Lock: similar to the monitor lock used by synchronized, but more powerfull, Condition...2012-08-14 23:49:38 · 132 阅读 · 0 评论 -
java udp 简单实现
java udp 简单实现------代码: * 运行方法: 直接 运行 UdpTest.java 的 main 函数 即可, * udp server package eric.j2se.net.udp;import java.net.DatagramPacket;import java.net.DatagramSocket;i...2011-02-20 18:36:39 · 130 阅读 · 0 评论 -
java 文件统计 工具类
import java.io.File;import java.io.FileWriter;import java.io.IOException;import java.util.ArrayList;import java.util.Arrays;import java.util.Date;import java.util.Iterator;import java...2011-02-18 23:55:23 · 251 阅读 · 0 评论 -
JDK版本不一样导致WTP项目错误
转载自:[url]http://xucons.iteye.com/blog/338054[/url]eclipse 中提示,错误信息:Java compiler level does not match the version of the installed Java project facet. 解决方法:右键点击出错的工程,选择属性,在弹出的preference中找到...2010-04-08 11:06:48 · 48 阅读 · 0 评论 -
String 中 equals() vs ==
String 中的 equals() 和 == :equals() 就是比较值,而不是引用;== 比较引用;如果2个String是引用2个相同的字面值,则这2个字符串变量都指向这个字面值,因此它们使用 == 比较,返回 true;如果 2者之一创建了新字符串对象,则用 == 比较就是 false;例子:[code="java"]public clas...2009-08-16 18:02:13 · 63 阅读 · 0 评论 -
class init & object creation
[b]class init & object creation in inheritance[/b]example:execute SelfBall.java 's main() function,then get the result.[b]GrandpaBall.java[/b][code="java"]/** * grandpa ball * @aut...2010-03-19 13:31:26 · 77 阅读 · 0 评论 -
udp 简单使用
[b]udp 概述[/b] user datagram protocol , 用户数据报协议, 无连接的协议,发送端无法得知发送结果, 特点: 高效, 稳定性 & 可靠性 差, udp 相关类:SocketAddress,DatagramPacket,DatagramSocket...2010-10-15 01:11:28 · 159 阅读 · 0 评论 -
String StringBuilder StringBuffer "..." 4种的效率
"..." +"..." 直接字面值的操作最快,因为 jvm 直接将其解释为 1个字符串String 对象 的操作 比较耗费时间,StringBuilder 还可以,非线程安全的StringBuffer 还行,线程安全,比 StringBuilder 慢点, 大多数情况下,效率上:"..." + "..." > StringB...2010-08-31 21:53:32 · 63 阅读 · 0 评论 -
统计 某目录下 文件中的 字符
统计给定目录下,所有文件中的 行数、空格数、数字个数: package test;import java.io.BufferedReader;import java.io.File;import java.io.FileReader;public class FileStatic { public static void main(String[] arg...2010-08-30 06:14:42 · 70 阅读 · 0 评论 -
多线程 通过 公共数据区 协调运行
多线程 通过 公共数据区 协调运行: 每个线程打印同1个字母,多个线程轮流打印,代码:package test;public class LetterPrinter extends Thread { public static final char[] cs = new char[] { 'h', 'e', 'l', 'l', 'o', ',' }; /**...2010-08-30 04:52:19 · 66 阅读 · 0 评论 -
java: lib & classpath
classpath, is the path to search for third-part or user-defined classes,refer to:* linux docs.oracle.com/javase/6/docs/technotes/tools/solaris/classpath.html docs.oracle.com/javase/6/docs/techno...2014-08-21 10:14:38 · 228 阅读 · 0 评论