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 is a method signature java?

1106


Which programming language is most secure?

1036


What are triggers in DB? Explain their types. How do they work?

1137


Is singleton class immutable?

1012


What are the advantages of encapsulation in java?

1049


What is the nested interface?

1157


What is a singleton class in Java?

1142


What are accessor methods in java?

1052


What is meant by inheritance and what are its advantages?

1160


Is a boolean variable?

1062


What is diamond operator in java?

1019


Objects or references which of them gets garbage collected?

1010


What are the steps involved to write rmi based programs?

1067


What is Java Shutdown Hook?

1264


Can we sort array in java?

1006