Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

did interface can implementation method ? i know its not
possible but my interviewer said its possible ..but how..?
any one have idea ???

Answer Posted / prabhu prasad

Hi Laxmidhar,

In your program you declare a reference variable, o1, of type interface A. Then you declare a new class that
has no name (means a anonymous class). Though A is an interface so the anonymous class actually implementing interface A…

If A is a class instead of interface then the anonymous class would be the subclass of A..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by synchronization?

985


How many ways can an argument be passed to a subroutine and explain them?

963


Why should I use abstract class?

1013


What is externalizable?

1011


State one difference between a template class and class template.

1022


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

907


What is set string?

1080


Differentiate jar and war files?

978


List types of storage classes in java?

1067


What is difference between call by value and call by reference?

933


What are the advantages of java over C++?

1142


How do you add spaces in java?

940


What is a lock or purpose of locks in java?

972


What is Major and importance difference between for and foreach loop ?

1074


what is synchronization and why is it important? : Java thread

1020