//package com.nowjava;
public class Main {
/**
NowJava.com - 时 代 Java 提供
**/
public static void main(String[] argv) {
Object object = "nowjava.com";
System.out.println(objectToSourceFileName(object));
}
/** Return a string representing the name of the file expected to
* contain the source code for the specified object. This method
* simply replaces "." with "/" and appends ".java" to the class
* name.
* @param object The object.
* @return The expected source file name.
*/
public static String objectToSourceFileName(Object object) {
String sourceFileNameBase = object.getClass().getName()
.replace('.', '/');/**来 自 N o w J a v a . c o m**/
// Inner classes: Get rid of everything past the first $
if (sourceFileNameBase.indexOf("$") != -1) {
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。