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 I have constructor in Interface?

Answers were Sorted based on User's Feedback



Can I have constructor in Interface?..

Answer / saroj kumar biswal

no we can't have constructor in an interface, why bcz constructor is used to initialize the instance variable stored in an object. Constructor is called concurrently while creating object. We can't create object to interface & also we can't provide instance variable to interface. So we can't use constructor in an interface

Is This Answer Correct ?    30 Yes 3 No

Can I have constructor in Interface?..

Answer / suresh

No a interface should not have constructor,
Because, interface will not extends with object class.
if any class extends with object class then atleast one
constructor should be there, if user fail to keep the
constructor the compiler will keep a default constructor
with first statement as super();.

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More Core Java Interview Questions

what is actual real time using of oops concepts in projects(Interface,polymorphism.abstraction.........)

2 Answers  


What is port number in java?

0 Answers  


What is variable explain?

0 Answers  


What is difference between final and immutable?

0 Answers  


Difference between Linked list and Queue?

0 Answers   Virtusa,


difference throws and throw in java

3 Answers  


What is the purpose of static keyword in java?

0 Answers  


How can we find size of the object ?

5 Answers   CTS, RazorSight,


Have you worked on bits programming? examples?What is bit? How many bits are there in the byte?

1 Answers  


Thanks A.jyotsna, Can u tell me differnce between abstract class and interface vikash

4 Answers  


What is the hashcode () and equals () used for?

0 Answers  


What are the data types supported by java? What is autoboxing and unboxing?

0 Answers  


Categories