Используя небольшую модификацию вашего примера:
Using echo";
function add1($x, $y){
$total = $x + $y;
echo $total;
}
$result = add1(2, 2);
echo "2 + 2 = ", $result, "
";
echo "Using return
";
function add2($x, $y){
$total = $x + $y;
return $total;
}
$result = add2(2, 2);
echo "2 + 2 = ", $result, "
";
?>
public ArrayList<String> getweakAreaCount() {
ArrayList<String> label = new ArrayList<>();
for (int i = 0; i < weakAreaList.size(); i++)
label.add(weakAreaList.get(i).getTopicNm());
return label;
}
xAxis.setValueFormatter(new IndexAxisValueFormatter(getweakAreaCount));