Abstract Method

I have 2 classes, person, child,I have to instantiate Person class into child class, but Person is overriding some abstract methods, so i make it abstract, now abstract classes can't be instantiated,can u tell me some way to come out of it,
[262 byte] By [shivani29a] at [2007-10-3 9:12:50]
# 1
> I have to instantiate Person class into child class,> but Person is overriding some abstract methods, so i> make it abstractWhat do you mean by this?
lupansanseia at 2007-7-15 4:25:08 > top of Java-index,Java Essentials,New To Java...
# 2
Create a class that provides implementation for the abstract methods and instantiate it.Do you know well what is abstract, or you just added the keyword in the class declaration just to satisfy the compiler?Mike
bellyrippera at 2007-7-15 4:25:08 > top of Java-index,Java Essentials,New To Java...
# 3

I'm not sure what you want to do but I think you are after something along the lines of:

public abstract class Person { ........... }

public class Child extends Person { ........... }

The logic also follows that:

public class Adult extends Person

This assumes that adults and children are all people.

_bensmytha at 2007-7-15 4:25:08 > top of Java-index,Java Essentials,New To Java...
# 4

HI

if a class as abstract methods, for that instance is not possible to create. why because ABSTRACT is nothing but not clear. while creating any objects or instances of classes, that has to not abstract class.

and same thing for interfaces also not able to create instances. becasue that is complete abstart....

java_marthona at 2007-7-15 4:25:08 > top of Java-index,Java Essentials,New To Java...
# 5

abstaract class A

{

void methodA();

}

class B extends A

{

void method()

{

System.out.println("hi");

}

public static void main(String args[])

{

//A a = new A();--it is not possible..

A a =new B();it is possible

}

}

java_marthona at 2007-7-15 4:25:08 > top of Java-index,Java Essentials,New To Java...