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 / shankar patil

You can't create an object without method implementations.
Anonymous inner classes allow you to do.

public interface MyInterface {
public void myMethod() ;
}

MyInterface myIntfObj = new MyInterface() {
public void myMethod() {
}
};

myIntfObj.myMethod();

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is string serializable in java?

1024


What is t in generics in java?

1070


What does a boolean method return?

1237


How big is a gigabyte?

1045


Can a constructor be made final?

1112


Is null or empty java?

988


Can we modify the throws clause of the superclass method while overriding it in the subclass?

1037


I want to print “hello” even before main is executed. How will you acheive that?

1089


What is the difference between the size and capacity of a vector?

1044


What is the flag in java?

1063


Why are the methods of the math class static?

1077


What is the difference between form & report?

1038


Why super is first line in java?

1056


Is a string literal?

1099


How do you create an array in java?

996