-
Need help with print
Happy Thanksgiving Everyone.
I'm trying to print the parameters/variables of Method "test".
If I use:
System.out.println (test(x));
I receive this error msg.:
Ex6e.java:15: test(int,char,double,int) in Ex6e cannot be applied to (int)
System.out.println (test(x));
If I use: System.out.println(x); I get a clean compile but no output. What's happening? Also can I print all of the parameters/variables at one time; with one print statement?
Thank you
Code:
import java.util.*;
import javax.swing.JOptionPane;
public class Ex6e {
public static void main(String[] args) {
}
public static int test(int x, char ch, double d, int y) {
x = 5;
ch = 'z';
d = 7.3;
y=5;
System.out.println(x);
return (x);
}
}