I have the following java program which is not getting compiled:
public class HelloWorld {
public static void funcA (String... params) {
funcB(params, "a", "b");
}
public static void funcB (String... params) {}
public static void main(String[] args) {
funcA("a", "b");
}
}
The compile error is as follows:
HelloWorld.java:4: error: method funcB in class HelloWorld cannot be applied to given types;
funcB(params, "a", "b");
^
required: String[]
found: String[],String,String
reason: varargs mismatch; String[] cannot be converted to String
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 709ms
What am I doing wrong?