Java调用Static修饰的本类方法

 1 public class Dy {
 2     public static void main(String[] args){
 3         
 4         int a=6;
 5         int b=5;
 6         int result=0;
 7         result=Add(a,b);               //调用本类方法Add()
 8         System.out.println(result);
 9     }
10     
11 private static int Add(int x,int y){  //定义方法Add(),求两数之和
12     return x+y;
13 }
原文地址:https://www.cnblogs.com/qiwu1314/p/6100577.html