Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Method Overloading by changing the data type of parameters Java

class MethodOverloading {

    // this method accepts int
    private static void display(int a){
        System.out.println("Got Integer data.");
    }

    // this method  accepts String object
    private static void display(String a){
        System.out.println("Got String object.");
    }

    public static void main(String[] args) {
        display(1);
        display("Hello");
    }
}
Comment

Method Overloading by changing the data type of parameters Java

class MethodOverloading {

    // this method accepts int
    private static void display(int a){
        System.out.println("Got Integer data.");
    }

    // this method  accepts String object
    private static void display(String a){
        System.out.println("Got String object.");
    }

    public static void main(String[] args) {
        display(1);
        display("Hello");
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: android java shared preferences 
Java :: reader java 
Java :: Add Future Date in AndroidStudio 
Java :: JAVA CHAR TO keyevents 
Java :: how to decode a ByteArray to Bitman in adroid 
Java :: extracting kubernetes podname from java 
Java :: create and populate list one line java 
Java :: java run multiple cmd commands 
Java :: Child inside NestedScrollView not cover full height of screen 
Java :: Java program to demonstrate working of HashTable 
Java :: java to exe 
Java :: advantages of iterator in java 
Java :: Java 8 merge multiple collections. 
Java :: java jbutton hover 
Java :: spring down load 
Java :: android getdrawable before api 21 
Java :: while (rem != 0); java 
Java :: firebase timestamp to textview 
Java :: java was started but returned exit code=13 
Java :: Java Stack class push() method 
Java :: accessdeniedexception amplify init 
Java :: 2 multiples 
Java :: java pebble replacestart 
Java :: javafx add vm options 
Java :: create new instance of class java 
Java :: select class field from list java 
Java :: .int x=5; final int y=7; x=x+10; y=y+10; 
Java :: ring check if the operating system is Android or not 
Java :: java schleife abbrechen 
Java :: stop countdown timer when exiting an activity 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =