Java.lang.Compiler类之compileClasses()方法具有什么功能呢?
下文讲述Compiler类compileClasses()方法的功能简介说明,如下所示:
Compiler类compileClasses()方法的功能
compileClasses()方法的功能:编译同参数中字符串匹配的所有类compileClasses()方法的功能
语法 public static boolean compileClasses(String string) 参数 string:类编译的名称 返回值 当编译成功时,则返回true 当编译失败或无编译器可用时,则返回false
Compile类compileClasses()方法的示例
package com.java.other;
import org.junit.Test;
public class other {
/**
* java265.com 静态方法测试示例分享
*
* @throws Exception
*/
@Test
public void test() throws Exception {
String str = "other";
boolean r = Compiler.compileClasses(str);
System.out.println("返回值:" + r);
}
}
-----运行以上代码,将输出以下信息----
返回值:false
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。


