Can we instantiate Interfaces?

Answer Posted / nagendra prasadu gandla

Yes you can instanciate but you have to implement the
methods of interface at the time of instanciation itself.

EX:
interface X
{
void abc();
}
class a
{
X z=new X(){void abc(){return;}};
}

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What super () does in java?

488


What are the steps involved to create a bean?

685


How do you represent a space in regex java?

526


How do you reverse sort in java?

508


What is bufferedwriter?

542






Can we execute a program without main?

543


Is empty .java file name a valid source file name?

593


Can we override the static method?

580


How many digits can a float hold?

539


EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

8630


How do you find the absolute value?

565


What is difference in between java class and bean?

573


What is final access modifier in java?

596


how does the run() method in runnable work? : Java thread

518


What are the 6 mandatory procedures for iso 9001?

533