我收到以下错误:
C:\Area52\AndroidProgramming>javac -d 。ex1.java ex1.java:27:错误:
没有找到适合 println(Object,Object) 的方法
System.out.println(players.get(0), batAvg.get(0)); ^ method PrintStream.println(Object) is not applicable (actual and formal argument lists differ in length)
这是我的代码:
package one.exercise;
import java.util.*;
public class ex1
{
public static void main(String[] args)
{
ArrayList players = new ArrayList();
players.add("Joey");
players.add("Thomas");
players.add("Joan");
players.add("Sarah");
players.add("Freddie");
players.add("Aaron");
ArrayList batAvg = new ArrayList();
batAvg.add(.333);
batAvg.add(.221);
batAvg.add(.401);
batAvg.add(.297);
batAvg.add(.116);
batAvg.add(.250);
System.out.println(players.get(0), batAvg.get(0));
System.out.println(players.get(1)); //+ batAvg.get(1));
System.out.println(players.get(2)); //+ batAvg.get(2));
System.out.println(players.get(3)); //+ batAvg.get(3));
System.out.println(players.get(4)); //+ batAvg.get(4));
System.out.println(players.get(5)); //+ batAvg.get(5));
}
}