Snippets

Ettar Java Overload

Created by Ettar
public class mainClass {
    public static void main(String[] ARGS){
        int testInt=1;
        double testDouble=2.3;
        String testString="abc";

        test1(testInt);
        test1(testDouble);
        test1(testString);
    }

    //Anlegen der ersten Methode mit String-Parameter
    public static void test1(String test){
        System.out.println(test);
    }
    //Anlegen der zweiten Methode mit Integer-Parameter
    public static void test1(int test){
        System.out.println(test);
    }
    //Anlegen der dritten Methode mit Double-Parameter
    public static void test1(double test){
        System.out.println(test);
    }
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.