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: 
Normaly, you can create a reference for an interface. But you cant create an instance for interface.
Yes we can, "Anonymous classes enable you to make your code more concise. They enable you to declare and instantiate a class at the same time. They are like local classes except that they do not have a name"-[>>Java Doc](http://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html)