Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA·´Éä»úÖÆÊÂÀý¶þ

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
try {
Class cls = com.lwf.util.CommonUtil.class;
Object obj = cls.newInstance();
Method addMethod = cls.getMethod("add", new Class[]{int.class,int.class});
Object value = addMethod.invoke(obj, new Object[]{new Integer(12),new Integer(23)});
System.out.println((Integer)value);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
package com.lwf.util;
public class CommonUtil {
public static void getName(){
System.out.println("this is a getName function");
}

public void getMethod(){
System.out.println("this is a getMethod funciton");
}

public int add(int m ,int n){
return m + n;

}
}


Ïà¹ØÎĵµ£º

Java SE ÄÚ²¿ÀàÓ뾲̬±äÁ¿

package demo;
class InOut{
 String str=new String("Between");
 static int i=666;
  int j=888;
  final int k=999;
 public void amethod(final int iArgs){
  int it315;
  final int x=111;
 /*static*/ class Bicycle
  { 
//&n ......

java±£ÁôÁ½Î»Ð¡Êý

/**
   * ±£ÁôÁ½Î»Ð¡Êý
   * @param d
   * @return
   */
  private static double remainTwoNumbers(double d){
    java.math.BigDecimal   f1   =   new   java.math.BigDecimal(d);//СÊýµãºó±£Áô2Î ......

javaÈÕÆÚת»»

/**
  * ´¦Àíʱ¼äÒì³£ Date to String
  * Èç¹ûת»»³öÏÖÒì³£»á¸øĬÈÏÖµ00:00
  * @param time
  * @param sdf
  * @return
  */
 public static  String handleDateParseException(Object time){
  String tempTime = "00:00";
  try{
   ......

ÉîÈëÁ˽âJavaµÄString

Ò»¡¢´Ó¸ù±¾ÉÏÈÏʶjava.lang.StringÀàºÍString³Ø
Ê×ÏÈ£¬ÎÒ½¨ÒéÏÈ¿´¿´StringÀàµÄÔ´ÂëʵÏÖ£¬ÕâÊÇ´Ó±¾ÖÊÉÏÈÏʶStringÀàµÄ¸ù±¾³ö·¢µã¡£´ÓÖпÉÒÔ¿´µ½£º
1¡¢StringÀàÊÇfinalµÄ£¬²»¿É±»¼Ì³Ð¡£public final class String¡£
2¡¢StringÀàÊǵı¾ÖÊÊÇ×Ö·ûÊý×échar[], ²¢ÇÒÆäÖµ²»¿É¸Ä±ä¡£private final char value[];
È»ºó´ò¿ªStr ......

javaÖÐÁ¬½Ó¸÷Êý¾Ý¿âµÄÇý¶¯ÀàºÍÁ¬½Ó·½Ê½

1.JAVAÁ¬½ÓACCESSÊý¾Ý¿â
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ="+application.getRealPath("/Data/ReportDemo.mdb");
Connection conn = DriverManager.getConnection(url,"","");
ÔÚÉÏÃæµÄÁ¬½Ó·½·¨ÖУ¬ËùÉæ¼°µ½µÄ²ÎÊýº¬ÒåÈçÏÂËùʾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ