Java random coords error?
I cannot seem to understand this error I'm getting. I've made a seperate class for random numbers, imported it and initiated it, but It say's I cannot use it?
Compiling loginserver...
src\com\rs2hd\net\ActionSender.java:745: s开发者_运维技巧endCreateObject(int,int,int,int,int,in
t) in com.rs2hd.net.ActionSender cannot be applied to (int)
player.getActionSender().sendCreateObject(randomElement)
;
^
randomElement =
Your sendCreateObject
is declared to take 6 integers as arguments. In your line
player.getActionSender().sendCreateObject(randomElement)
you're only giving it one!
To give you an example, the code below gives the exact same error message:
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);
}
}
精彩评论