有参无返回值的方法举例
例:计算2个数的和
package com.xuenixiang.Shin;
public class YouCanWuFanHuiZhi {
public void a(int i,int j) {
int count =i+j;
System.out.println(count);
}
public static void main(String[] args) {
YouCanWuFanHuiZhi jiafa=new YouCanWuFanHuiZhi();
jiafa.a(4, 6);
}
}
运行结果: