12345678910111213141516171819 |
- package com.loveCoding.j20250524_method;
- /**
- * @author WanJl
- * @version 1.0
- * @title Demo03
- * @description
- * @create 2025/5/24
- */
- public class Demo03 {
- //创建一个减3的方法,无论谁调用了这个方法,传入了多大的数值,方法的运行结果都是传入的数-3
- public static int m(int a){
- return a-3;
- }
- public static void main(String[] args) {
- int m = m(6);
- System.out.println(m);
- }
- }
|