package com.oop.demo01;//方法的回顾:实参和形参 public class Demo03 { public static void main(String[] args) { //实际参数要和形式参数要对应! int add = new Demo03().add(5, 2);//实际参数 System.out.println(add); } // 形式参数 public int add(int a, int b){//方法 return a+b; } /* public static void main(String[] args) { Demo03.add(1,2) Systenm.out.println(add); } public static int add(int a, int b){//方法 return a+b; } */ }
03-16
655