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 we inherit the constructor in a Class?please give one
example.

Answer Posted / amit

class demo
{
demo()
{
System.out.println("i am default constructor ");
}
}
class demo1 extends demo
{
demo1()
{
System.out.println("i am default constructor ");
}
}
class test
{
public static void main(String st[])
{
demo1 ob=new demo1();
}
}




but it is inherited constructor ....so be can say inherited constructor or/not ?????????

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of classloaders?

1015


Can we store variables in local blocks?

1347


What are the main features of java?

969


What is the difference between static binding and dynamic binding?

1122


What is var keyword ?

1179


State the difference between strings and arrays.

1238


How do you clear a method in java?

1005


What does super keyword do?

1071


Difference between Preemptive scheduling vs. Time slicing?

1017


What is a ternary operator in java? What is an interface?

996


How to sort an array in java without using sort method?

874


What is difference between length and length() method in java ?

992


What is data object example?

1007


How objects are stored in java?

1033


Which number is denoted by leading zero in java?

1237