私は現在Javaプロジェクトを行っており、StringBufferがこの特定のタスクを実行するのに大いに役立つと感じています.Matrixの文字列表現を「構築」しています:
/**
* Returns a String representation of the Matrix using the getIJ getter
* function. You should use MaF.dF to format the double numbers to a
* sensible number of decimal places and place the numbers in columns.
*
* @return A String representation of the Matrix
*/
public String toString() {
//String stringBuilder = new String
StringBuffer beep = new StringBuffer;
for(i=0; i<m-1; i++){
for(j=0; j<n-1; j++){
}
// You need to fill in this method
}
私はそれをJavaプログラムで試してみましたが、問題ないように見えましたが、オンラインからサンプルJavaプログラムを試してみましたが、コンパイルされませんでした. StringBuffer
Java に組み込まれていますか、それともパッケージをインポートする必要がありますか? このプロジェクトのパッケージをインポートすることは許可されていません。
また、MaF.dF とは正確には何なのか、誰か教えていただけないでしょうか? どのように使用されますか?オンラインで何も見つからない MaInput の一部だと思います。