Here you can find the source of printDataPoint(List
public static String printDataPoint(List<Double> dataPoint)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String printDataPoint(List<Double> dataPoint) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < dataPoint.size() - 1; i++) { sb.append("x" + i + "=" + dataPoint.get(i) + ", "); }//from w ww . j av a 2s . co m sb.append("y=" + dataPoint.get(dataPoint.size() - 1)); System.out.println(sb.toString()); return sb.toString(); } }