易截截图软件、单文件、免安装、纯绿色、仅160KB

Java Reflection 浅析2

inner class和outer class之间的reflection应用。
package com.gaoqian.reflection;
import java.lang.reflect.Field;  
import java.lang.reflect.Modifier;  
import java.lang.reflect.Constructor;  
import java.lang.reflect.Method;  
 
class IncludeInnerClass implements Runnable{  
    class DefaultInnerClass{  
        int i;  
        public DefaultInnerClass(){}  
        DefaultInnerClass(int i){  
            this.i = i;  
        }  
        void innerMethod(){  
            System.out.println("I am DefaultInnerClass.");  
        }  
    }  
    private class PrivateInnerClass{  
        int i;  
        PrivateInnerClass(){}  
        PrivateInnerClass(int i){  
            this.i = i;  
        }  
        void innerMethod(){  
            System.out.println("I am PrivateInnerClass.");  
        }  
    }  
    public class PublicInnerClass{  
        int i;  
        p


相关文档:

Java SE 多线程

package thread;
class TestThread extends Thread {
 public void run(){
  while(true){
   System.out.println(Thread.currentThread().getName());
  }
 }
}
public class ThreadDemo {
 /**
  * @param args
  */
 public static void ......

Java SE 多线程 线程通信

package thread;
class QQ{
 private String name;
 private String sex;
 boolean flag=false;
 public synchronized void put(String name,String sex){
  if(flag)
   try {
    wait();
   } catch (InterruptedException e ......

java GB转 UTF 8字符

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class GB2UTF
{
 public static String GBK2Unicode(String str)
 {
  StringBuffer result = new StringBuffer();
  for (int i = 0; i < str.length(); i++)
 &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号