【发布时间】:2014-02-02 21:04:01
【问题描述】:
System.out.println("Enter a sentence to get it translated into Pig Latin: ");
String sentence=kb.nextLine();
String[] words = sentence.split(" ");
char a=words.charAt(0);
【问题讨论】:
-
words是String[]。数组类型只有继承自Object的方法,即。不是charAt(int)。