V
V
vampireall22020-02-01 16:34:26
Java
vampireall2, 2020-02-01 16:34:26

What methods in Java are not allowed here?

Can't figure out which of the following method declarations are not valid and why? Ask to explain in detail, I would like to understand at least 1 point. I know Java, but I'm learning from trial and error, and in theory I can't explain it here. Thank you for your replies.

1. public final abstract int doAnything();
2. public abstract int doA(int j);
3. public private void notC(boolean flag);
4. final abstract boolean isEqual(float c, float d);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2020-02-01
@vampireall2

1. public final abstract int doAnything();
it makes sense to finalize a method that has no implementation
4. final abstract boolean isEqual(float c, float d);
there is also finalization and perhaps public is missing
3. public private void notC(boolean flag);
so the method is public or private
2. public abstract int doA(int j);
seems ok

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question