其他分享
首页 > 其他分享> > shift+F6

shift+F6

作者:互联网

shift+F6 java编程中变量可一起修改

package cn.itcast.day04.demo04;

// byte short int long float double char boolean
// String
// 在调用输出语句的时候,println方法其实就是进行了多种数据类型的重载形式。
public class Demo04OverloadPrint {

    public static void main(String[] args) {
        myPrint(100); // int
        myPrint("Hello"); // String
    }

    public static void myPrint(byte num) {
        System.out.println(num);
    }

    public static void myPrint(short num) {
        System.out.println(num);
    }

    public static void myPrint(int num) {
        System.out.println(num);
    }

    public static void myPrint(long num) {
        System.out.println(num);
    }

    public static void myPrint(float num) {
        System.out.println(num);
    }

    public static void myPrint(double num) {
        System.out.println(num);
    }

    public static void myPrint(char zifu) {
        System.out.println(zifu);
    }

    public static void myPrint(boolean is) {
        System.out.println(is);
    }

    public static void myPrint(String str) {
        System.out.println(str);
    }

}

标签:F6,myPrint,shift,void,num,static,println,public
来源: https://blog.csdn.net/weixin_34273095/article/details/113838283