[求助]如何删除最大项目问题
这个作业时要求先画出顺序图,然后根据图来编写我把图画出来了,可是不会写如何删除最大项目
这个事我写的一些javacode:
import java.io.*;
public class Player
{
public static void main(String args[])
{
MultiItem []item = new MultiItem[3];
item[0] = new MultiItem("rope",10);
System.out.println(item[0].getname()+","+item[0].getweight());
}
}
public class Inventory
{
}
public class MultiItem
{
private String name;
private int weight;
public MultiItem(String name, int weight)
{
this.name = name;
this.weight = weight;
}
public String getname()
{
return name;
}
public int getweight()
{
return weight;
}
}
拜托各位大侠帮帮忙~