Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

if i have an abstract customer class why is it giving me error: package lasthw; public abstract class Customer extends Thread { public int processing(); } dont i just need to declare the method and the subclasses need to implementit?

OpenStudy (anonymous):

@eSpeX :)

OpenStudy (espex):

You have a package declared and it cannot be found in the path of your project.

OpenStudy (anonymous):

nope, that doesnt help

OpenStudy (anonymous):

it has to do with the return type . since its type INT the customer class itself wnats me to have a return

OpenStudy (anonymous):

is it okay if i just make that method ABSTRACT as well?

OpenStudy (espex):

Slow down a second, one thing at a time. What exactly is the code doing and what exactly is your error message?

OpenStudy (anonymous):

i have an abstract class customer. there are subclasses (dealer, teenager, customPerson) and they all have a processing wait time. so i want to have that method in the superclass.

OpenStudy (espex):

Okay, makes sense.

OpenStudy (anonymous):

so is that a yes to the abstract method as well?

OpenStudy (espex):

Are you defining it within the abstract class?

OpenStudy (espex):

Err I meant to say, implementing it, I assume it is defined.

OpenStudy (anonymous):

yes

OpenStudy (espex):

Then you do not have to declare your subclass abstract or even worry about implementing the method. All you will need to do is pass a variable to it.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!