package com.karl2; public class MethoOverDemo { public static void main(String[] args) { //方法重载 kokoko(); sasasa(100); fire(); fire("米国"); fire("米国",999); } public static void kokoko(){ System.out.println("kokoko"); } public static void sasasa(int a){ System.out.println("sasasa"); } public static void fire(){ System.out.println("默认给岛国发射了一枚武器"); } public static void fire(String country){ System.out.println("发射了一枚武器给"+country); } public static void fire(String country,int number){ System.out.println("发射了"+number+"枚武器给"+country); } }
标签:fire,void,System,static,重载,方法,public,out From: https://www.cnblogs.com/Karl-hut/p/17438016.html