Sunday, July 15, 2018

What will be the output of overriding concept?

Problem statement: what will be the output of the below code?
class C{
    public void run(int a){
        System.out.println("int: "+a);
    }
    public void run(long a){
        System.out.println("long");
    }
}
public class DemoSample1 {
    public static void main(String args[]){
        C c = new C();
        c.run('a');
    }
}
Output:
int: 97

No comments:

Post a Comment

How to run standalone mock server on local laptop

 Please download the standalone wiremock server from Direct download section at the bottom of the page.  Download and installation Feel fre...