将字符串从一个类传递到另一个类

时间:2015-01-09 10:59:33

标签: java

问题是,当我运行程序时,我看不到输出结果(在控制台窗口中显示为空白)&没有错误消息或警告。谁能告诉我,什么错了?

public class Test1 {

    static String temp = null;

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Test2 var = new Test2();
        temp = var.DBType("Australia", "Melbourne");
        System.out.println("Main class: "+temp);
    }
}

package individualFunctionTest;

public class Test2 {

    public String DBType(String dbType, String dtMap) {

        System.out.println("Country to: " +dbType+" "+dtMap);
        dbType = "India";
        dtMap = "Bangalore";
        return dbType;
    }

}

0 个答案:

没有答案