I
I
Ivan the Terrible2015-09-23 13:41:52
Java
Ivan the Terrible, 2015-09-23 13:41:52

Where is the mistake?

public static String rhymeCount() {
}
Throws an error: "Illegal modifier for parameter rhymeCount; only final is permitted".
What is the problem ?
JDK 8.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-09-23
@disc

Local variables and parameters cannot have public or private modifier. You can only give final to them.

Remove public from the method

V
Valera Programmer, 2015-09-23
@noddux

You can't just take and declare a static variable inside a method!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question