public class Test1
{
public static void leftshift(int i, int j)
{
i+=j;
System.out.println(i);
}
public static void main(String args[])
{
int i = 4, j = 2;
leftshift(i, j);
class OperationDemo
{
public static int leftshift(int i, int j) {
i+=j;
return i;
}
public static void main(String args[]) {
int i = 4, j = 2;
i=leftshift(i, j);
System.out.println(i);
}
}
这样也可以