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

Which is better arraylist or vector?

1066


Why do we need autoboxing in java?

1057


How to write custom exception in java?

1109


Define max and min heap, also the search time of heap.

1075


what is the purpose of using rmisecuritymanager in rmi?

1012


What are methods in java?

1035


What is jit compiler ?

1039


In java, how many ways you can take input from the console?

1039


Can you write a java class that could be used both as an applet as well as an application?

1000


Is java a utf 8 string?

1021


What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?

1094


What does percent mean in java?

1073


Explain the concept of proper inheritance?

1107


What are use cases?

1015


When should you make a function static?

1031