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...

Describe inheritance as applied to java?

Answer Posted / chandra rekha

Inheritance is one of the OOPS concepts(the OOPS concepts
are Abstraction,Encapsulation,Polymorphism and Inheritance).
Java is purely a OOP language.

Inheritance is the ability of a class to use member data
and methods of another class.This is done by deriving a
class from a diff class.The class from which it derives is
called the base or the parent or super class and the class
which derives is called the derived or the child or sub
class.

Java supports two types of inheritance SINGLE inheritance
and MULTILEVEL inheritance."extends" is the keyword to
inherit properties of the base class.All the derived
classes having a single base class is termed as the single
inheritance.for example
class A
{
...
}
class B extends A
{
...
}
public class C extends A
{
...
}
this is single inheritance

whereas, a class inherits the properties of another class,
for example
class A
{
...
}
class B extends A
{
...
}
public class C extends B
{
...
}

java doesnot support multiple inheritance.However, a class
can implement any number of interfaces(interface is a
collections of methods with no definition(abstract methods))

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you check if a string contains only numeric digits?

1066


If an application has multiple classes in it, is it okay to have a main method in more than one class?

968


Can a abstract class be declared final?

944


What is the purpose of the main method?

944


Describe 2 different ways to concatenate two strings.

1144


Is ++ operator is thread safe in java?

891


What is a byte string?

1051


How will you call an Applet using Java Script Function?

961


How does a for loop work java?

985


How do you use spaces in java?

943


Difference between method overloading and overriding.

1015


What is string substring?

1099


What is return in java?

907


What is meant by data hiding/encapsulation?

1043


What is the difference between iterator and enumeration ?

955