我真的不知道如何表达这个问题,因为我真的不明白该怎么做
我有两个“.java”文件
创建文件:
public void addRecords(String Package, String ClassName, String[] ListOfBoxes)
{
format.format("%s", "package " + Package + ";"\n");
format.format("%s", "@SideOnly(Side.CLIENT)\n");
format.format("%s", "public class " + ClassName + " extends ModelBiped\n");
format.format("%s", "{\n");
format.format("%s", " ModelRenderer " + ListOfBoxes + ";\n");
format.format("%s", "}\n");
}
我试图运行的代码
createFile file = new createFile();
file.openFile();
String[] Boxes = {"test1", "test2", "test3"};
file.addRecords("default", "ModelTest", Boxes);
file.closeFile();
这是输出:
package net.minecraft.client.model;
@SideOnly(Side.CLIENT)
public class ModelTest extends ModelBiped
{
ModelRenderer [Ljava.lang.String;@3794d372;
}
这就是我要的
package net.minecraft.client.model;
@SideOnly(Side.CLIENT)
public class ModelTest extends ModelBiped
{
ModelRenderer test1;
ModelRenderer test2;
ModelRenderer test3;
}
这可能很简单,但我是 java 的菜鸟
提前致谢