⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getproperty.java~1~

📁 1. 消息即时通信 2. 消息发送实现一对一、一对多等多种发送模式 3. 发送的消息实现多彩文本编辑
💻 JAVA~1~
字号:

import java.lang.reflect.*;

public class getproperty {
  //static String string=null;
  static String s=null;
  static int i;
  static Object object=null;
  public static String getconfig(String className,String string){
    System.out.println("ok");
   /* if((i=className.lastIndexOf("."))!=-1){
      object=(Object)className.substring(i+1);
      System.out.println(object);
    }
    else{
      object=(Object)className;
    }*/
    try{
      System.out.println(className);
      //string=string;
//      Class propertyclass = Class.forName("hellojxta.property");
      Class propertyclass = Class.forName(className);
      System.out.println(className);
      Field field=propertyclass.getField(string);
      //System.out.println(string);
      object=propertyclass.newInstance();
     // hellojxta.property property=new hellojxta.property();
     // object property=new object();
      //(Object)className property=new (Object)className();
      //getproperty getproperty=new getproperty();
      //s=(String)field.get(property);
      s=(String)field.get(object);
      return s;
    }catch(Exception e){
      e.printStackTrace();
    }
    return s;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -