fork download
  1. package test;
  2.  
  3. class test {
  4. public static void Main (String[] args) {
  5. System.out.println(test.p("abc", 6, '-'));
  6. }
  7. public static String p (String s, int l, char ...p) {
  8. return s.length() < l
  9. ? p (p.length > 0 ? p[0] : ' ' + s, l, p)
  10. : s;
  11. }
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:9: error: incompatible types: bad type in conditional expression
      ? p (p.length > 0 ? p[0] : ' ' + s, l, p)
                           ^
    char cannot be converted to String
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
stdout
Standard output is empty