Question: Is it possible to create an instance of an interface in Java?

Somewhere I have read that using inner anonymous class we can do it as shown below:

```java
interface Test {
    public void wish();
}

class Main {
    public static void main(String[] args) {
        Test t = new Test() {
            public void wish() {
                System.out.println("output: hello how r u");
            }
        };
        t.wish();
    }
}

```

```none
cmd> javac Main.java
cmd> java Main
output: hello how r u

```

Is it correct here?

Answer: 
Yes, your example is correct. Anonymous classes can implement interfaces, and that's the only time I can think of that you'll see a class implementing an interface without the "implements" keyword. Check out another code sample right here:

```java
interface ProgrammerInterview {
    public void read();
}

class Website {
    ProgrammerInterview p = new ProgrammerInterview() {
        public void read() {
            System.out.println("interface ProgrammerInterview class implementer");
        }
    };
}

```

This works fine. Was taken from this page:

<http://www.programmerinterview.com/index.php/java-questions/anonymous-class-interface/>
No in my opinion , you can create a reference variable of an interface but you can not create an instance of an interface just like an abstract class.