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 a class inherit the constructors of its superclass?

Answer Posted / gayathri

import java.io.*;

class Parent
{
Parent()
{
System.out.println("This is super class Constructor");
}
}
class Code3 extends Parent
{
Code3()
{
System.out.println("This is child class");
}
public static void main(String ar[])
{
Code3 c=new Code3();
}
}

Here if i call the child class constructor,even the parent class constructor is implicitly invoked,that means constructors can be inherited.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a java predicate?

914


What is binary tree in java?

1004


Why scanner is used in java?

1010


Explain what is encapsulation?

1011


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread

955


What does system out println () do?

965


what is the significance of listiterator in java?

1026


What is keyword in oop?

914


What technique is carried out to find out if a particular string is empty?

972


What is consumer interface?

946


What is the file type?

963


Tell me are there implementations for sorting and searching in the java libarary?

977


What is autoboxing in java?

1013


What does bitwise or mean?

1032


What is the major difference between linkedlist and arraylist?

963