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...

can you create interface instance ?

Answer Posted / kishore emani

Hi Anil, In this case uday sounds good!
As per your consideration if it is an anonymous class then
just remove that interface from our application and try to
compile it won't compile that code.
Here Test is an interface, for which to create the object
we need to provide the complete implementation for that
interface the same thing which uday did.
and again u check it if(t instanceof Test)
it is returning true that means t is an instance for Test.
and here the object is creating in the heap.
at finally here an instance is created for an interface.

Is This Answer Correct ?    4 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which sorting algorithm is best in java?

1026


What is the arraylist in java?

1115


What is broken and continue statement?

1063


Can we execute a program without main?

1079


How many types of operators are there?

1031


What is the primitive type byte?

1043


What does jenkins do?

970


What are the different types of garbage collectors in java?

1207


What are the differences between getting and load method?

1295


What are the differences between graph and tree?

1159


What is difference between checked and unchecked exception in java?

1062


What are the steps that are followed when two computers connect through tcp?

1040


can I implement my own start() method? : Java thread

1040


From the two, which would be easier to write: synchronization code for ten threads or two threads?

1106


What are design patterns and please explain?

1136