Impetus Interview Questions: Code Snipet 1

What will be the output of the code?

interface TestOne{
    int limit=100;
    void display();   

interface TestTwo{
    int limit=200;
    void display();   

public class TestInterface implements TestOne,TestTwo{
    //int limit=0;
    public void display() {
        System.out.println("Hello... Test interface...."+limit);
    public static void main(String [] arg){
        TestInterface obj=new TestInterface();


Output: Compiler error at System.out.println(....) : The field "limit" is ambiguous.


Popular posts from this blog

Struts 2 - struts tag with boolean property

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.