Всем привет, подскажите плиз как можно в качестве парметра метода, вызвать другой метод) типа method(anothermethod(string) )
public class Main {
public static void main(String[] args) {
String temp = "1,2,3,4,5,6,7,8,9";
System.out.println(getText(getParams(temp)));
}
static String getText(List<String> list) {
StringBuilder text = new StringBuilder();
for (String s : list) {
text.append(s);
}
return text.toString();
}
static List<String> getParams(String temp) {
return Arrays.asList(temp.split(","));
}
}