Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java随机坐标错误?_Java_Compilation - Fatal编程技术网

Java随机坐标错误?

Java随机坐标错误?,java,compilation,Java,Compilation,我似乎无法理解我所犯的这个错误。我为随机数创建了一个单独的类,导入并启动了它,但它说我不能使用它 Compiling loginserver... src\com\rs2hd\net\ActionSender.java:745: sendCreateObject(int,int,int,int,int,in t) in com.rs2hd.net.ActionSender cannot be applied to (int) player.getA

我似乎无法理解我所犯的这个错误。我为随机数创建了一个单独的类,导入并启动了它,但它说我不能使用它

Compiling loginserver...
src\com\rs2hd\net\ActionSender.java:745: sendCreateObject(int,int,int,int,int,in
t) in com.rs2hd.net.ActionSender cannot be applied to (int)
                        player.getActionSender().sendCreateObject(randomElement)
;
                                                ^

randomElement = 
sendCreateObject被声明为以6个整数作为参数。你行吗

player.getActionSender().sendCreateObject(randomElement)
你只给了它一个

举个例子,下面的代码给出了完全相同的错误消息:

public class Test {

    static void sendCreateObject(int a, int b, int c, int d, int e, int f) {
    }

    public static void main(String[] args) {
        sendCreateObject(1);
    }
}

如果不向我们展示你的代码,我们真的无法告诉你你做错了什么。看起来你在尝试使用两种不一致的东西。那么我如何让它工作,它的加载6,但randomElement是一个加载6?randomElement是一个加载6意味着什么?sendCreateObject需要六个数字来完成它的工作,就像告诉银行转账至少需要两个帐户和一个金额一样。你只给了它一个号码。这就像走进一家银行,说我想转帐5000美元,但不说从哪里转帐,也不说从哪里转帐。由于您没有告诉我们sendCreateObject实际做什么或它的参数是什么,也没有告诉我们这个randomElement数字来自何处,因此我们无法告诉您需要做什么。sendCreateObject将对象ID发送到游戏上的指定坐标。我所说的randomElement是指一个加载六个,randomElement等于,例如32660,0,1337,1264,0,10,但是它加载了多个不同字符串,比如32660,0,1337,1264,0,1032660,0,2582,9345,0,10