Television(boolean power, int channel, int volume);
Keep getting error "missing method body or declare abstract"
Can't understand why?
Help please :)
If you need to see all code ask
TOM
Television(boolean power, int channel, int volume);
Keep getting error "missing method body or declare abstract"
Can't understand why?
Help please :)
If you need to see all code ask
TOM
Jump to PostYou have to write the method using a method body. What's the point of having a method that does nothing, like your current one would, anyway? Either that or declare the class as abstract.
Listen to your compiler.
Do not terminate Method unless it is abstract.
Television(boolean power, int channel, int volume);
could be
Television(boolean power, int channel, int volume) {
}
I tried doing..
abstract Television(boolean power, int channel, int volume);
but it came back with "modifier abstract not allowed here"
TOM
You have to write the method using a method body. What's the point of having a method that does nothing, like your current one would, anyway? Either that or declare the class as abstract.
Listen to your compiler.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.