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 :: @Async how it works @EnableAsync 
Java :: why the fuck java suck 
Java :: netbens setdefaultbutton 
Java :: random class in java 
Java :: preset arraylist java 
Java :: md5 java ee 
Java :: repeat a string in java 
Java :: get method jdbc 
Java :: android pick up photo from local device 
Java :: instance block in java 
Java :: access db in fragments 
Java :: programme javascrip mineur et majaur 
Java :: input method manager hide keyboard 
Java :: reactive kafka 
Java :: java fill in the code to read and store the next value in the array 
Java :: preparestatement method in java 
Java :: the crystallization in time is the phenomenon that we call synchronization 
Java :: Iterating The Queue Elements 
Java :: how to implement seekbar for music in java 
Java :: difference between compile and execute in java 
Java :: Java HashMap Class Declaration 
Java :: java enum valueof() 
Java :: The root directory of the External Storage on every android version 
Java :: java program on stack for beginners 
Java :: how to display same statement multiple times in java 
Java :: closable resources java 
Java :: Spring security avec spring version 2.5.6 
Java :: How to convert Javascript return value to String in Android 
Java :: java scan next into array 
Java :: add element to queue java 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =