嗨我想通過objectA
和objectB
,我創建從方法ListA()
和ListB()
到DoSomething
方法,可有人請指導我如何做到這一點?如何使用JAva中另一種方法創建的對象?
public static void main(String[] args)
{
myclass test = new myclass();
test.ListA(args[0]);
test.ListB(args[1]);
test.DoSomething(objectA, objectB);
}
public void ListA(String aaa){
objectA = Sting[];
//other codes goes here...
}
public void ListB(String bbb){
objectB = Sting[];
//other codes goes here...
}
public static void DoSomething(List<String>objectA, List<String>objectB}{
//other codes goes here...
}
或者將值存儲在類本身中。 – skuntsel 2013-04-27 11:42:46