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

Java Compiler is stored in JDK, JRE or JVM?

1520


Is list ordered in java?

967


How many characters is 2 bytes?

984


How many types of exception can occur in a java program?

985


What is :: operator in java?

966


What do you mean by order of precedence and associativity?

941


What is the difference between preemptive scheduling and time slicing in java programming?

1011


Define iterator and methods in iterator?

965


what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

2169


Can we cast any other type to boolean type with type casting?

953


Is singleton thread safe in java?

968


Why bytecode is called bytecode?

1189


What is the difference between a constructor and a method?

1241


Is it possible to compare various strings with the help of == operator?

986


What does substring mean?

973