我必須按字母順序使用字符串Tokenizer和String方法放置單詞。我是一個Java初學者,所以我只知道像char,比較,布爾操作,if語句,switch語句,while循環和String Tokenizer等... 我有這個到目前爲止。使用字符串Tokenizer按字母順序放置單詞
import java.util.*;
public class Alphabetize
{
// Establish Global Class-State Variables
static StringTokenizer st;
public static void main()
{
// Input Data
inData();
//Variable Assigment
varAssign();
//Process Data
alphaOrder();
//Output Information
outPrint();
}
public static void inData()
{
// Input Data
String n= "Hailee James Kate Emily Alex Jackie";
st = new StringTokenizer (Hailee James Kate Emily Alex Jackie);
}
public static void varAssign()
{
//Process Data
}
public static void alphaOrder()
{
//Outprint Information
}
public static void outPrint()
{
}
}
開始通過讀取的Javadoc https://docs.oracle.com/ja vase/7/docs/api/java/util/StringTokenizer.html –