Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

Got a coding problem. public class Test { public static int mystery3(String [] args) { int x = 3; int y = 3; while (x != 0 && y != 0) { if (x < y) { y -= x; } else { x -= y; } } return x + y; } } I get the error that there is no void method accepting string[]. Yet if i switch to a void, I get another error that says that voids can't send a return.

OpenStudy (e.mccormick):

Java? Are you trying to make a main program or a callable class? If a callable class, are you calling it with something being passed to it, or are you trying to call it without any arguments? have a look at this too: http://www.tutorialspoint.com/java/java_object_classes.htm

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!