06 2014 档案
摘要:@Test public void test(){ //new UserImpl(); /* ProxyT proxy=new ProxyT(new UserImpl()); proxy.add(); proxy.update();*/ final User user=new UserI...
阅读全文
摘要://用户操作的接口public interface User { public void add(); public void update(); }//用户接口的实现类public class UserImpl implements User { @Override public void ad...
阅读全文
摘要://之前懒得打字,今天稍微啰嗦点。说说什么是java反射,这个打个比喻,反射就像是一面镜子,通过它我们可以反观自己。反射其实就是用于描述java类的一个机制,通过它,可以了解类的属性和方法,在java的代理中就用到了反射。下面是我学习过程中的一些代码。 public static void main...
阅读全文
摘要://缓存数据流 @Test public void testBufferReaderAndWriter() throws IOException{ //创建文件字符输入流 Reader in=new FileReader("abc.txt"); BufferedReader br=new Bu...
阅读全文
摘要://输出流 @Test public void testOutStream() throws Exception{ OutputStream out =new FileOutputStream("abc.txt"); String content="hello word/nwww.baidu.c...
阅读全文
摘要:@Test public void test() throws Exception{ //创建输入数据流对象 InputStream In=new FileInputStream("HellWord.txt"); try { //System.out.print((ch...
阅读全文
摘要:@Test public void fileTest() { //创建File 对象 File file=new File("hell.txt"); //获取文件名 System.out.println(file.getName()); //访问文件的绝对路径 System.out.p...
阅读全文
摘要:public enum Season2 implements Info{ spring("春天","春风又路江南岸"), summer("夏天","映日荷花别样红"), autumn("秋天","秋水共长天一色"), winter("冬天","千树万树梨花开"); final String seas...
阅读全文
摘要:package com.javasort;/***一个类只能有四个固定的对象 且属性固定的实现*/public class Season { private final String SEASON_NAME; private final String SEASON_DESC; private S...
阅读全文

浙公网安备 33010602011771号