java BufferedReader和InputStreamReader的区别
BufferedReader:
Read text from a character-input
stream, buffering characters so as to provide for the
efficient reading of characters, arrays, and lines.
InputStreamReader:
An InputStreamReader is a bridge from byte streams to
character streams: It reads bytes and decodes them
into characters using a specified charset.
相关文档:
其技巧就是:定义一个简单接口,并在该接口中声明我们要调用的方法,一般可以应用在键盘鼠标事件跟踪。
下面举一个例子:
假定我们希望在某个事件发生时得到通知。我们可以定义一个接口:
/*
* 在某个事件发生时得到通知.
*/
public interface InterestingEvent {
public void interestingEvent() ......
在网上看了好多人,对jdk的环境变量配法不祥,在此小结一下
前提条件:电脑上安装了jdk
步骤:
1)我的电脑/系统属性/高级/环境变量/用户变量/新建
a)变量名:JAVA_HOME
变量值:E:\Program Files\Java\jdk1.5.0_04(jdk安装路径)
b)变量名:PATH
变量值:%JA ......
定义一个native 方法:
package ext;
import java.util.Hashtable;
public class TestJNI
{
static
{
System.loadLibrary("dllfile");
}
public TestJNI()
{
......
public static void main(String[] args){
SimpleDateFormat da = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Calendar calendar = Calendar.getInstance();
Date date = calendar.getTime();
String aimTime ="2010-02-03 17:30:00.000";
int count = 0;
Date aimDate = d ......
import java.io.UnsupportedEncodingException;
/**
* 转换字符串的编码
*/
public class ChangeCharset {
/** 7位ASCII字符,也叫作ISO646-US、Unicode字符集的基本拉丁块 */
public static final String US_ASCII = "US-ASCII";
/** ISO 拉丁字母表 No.1,也叫作 ISO-LATIN-1 */
public static final String ISO_ ......