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 / arnold schwarzenegger

Yes we can create an instance of Interface but not directly but by using its subclass. Just check the below code


interface check
{
public void method1();
}
abstract public class B implements check
{

public static void main(String[] args)
{
check c = new check()
{
public void method1()
{
System.out.println("interface B m2");
}
};
c.method1();
}
}

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 procedure writing?

916


Can you give few examples of final classes defined in java api?

961


What are encapsulation, inheritance and polymorphism?

956


What is the difference between stringbuffer and stringbuilder class?

1043


How is java created?

898


How do you reverse a word in java?

1005


What is a void method?

886


What is the main use of generics in java?

924


Can you tell me range of byte?

950


What is the technique adopted to create an immutable class?

1046


Is a char always 1 byte?

939


Difference between serialization and deserialization in java?

1085


Describe different states of a thread.

946


When do we use synchronized methods in java?

996


What is a Null object?

1536