can you create interface instance ?

Answer Posted / ramu

hey uday u r wrong
In your program you are not created obj for interface, you have given anonymous implementation for 'Test' interface and instantiated that anonymous class only but not the interface.
for conformation call getClass() on 't'.(t.getClass())

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is alive method in java?

493


What is a databasemetadata?

535


What is the public method modifier?

529


What is anagram of a string?

503


How to invoke external process in java.

553






What data type is true or false?

561


Write a program in java to create a doubly linked list containing n nodes.

545


What is the difference between quicksort & mergesort? When should they be used? What is their running time?

642


Can size_t be negative?

598


What are the two types of exceptions in java? Which are the differences between them?

502


Can java list be null?

537


Explain the difference between collection api and stream api in java8?

492


What are the basic concepts of OOPS in java?

555


What is a nested list?

506


What is multi level inheritance in java?

541