Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8154588

Error expected for declaring a 'clone' default method

XMLWordPrintable

      This declaration compiles without error:

        interface I1 {
          default Object clone() { return this; }
        }

      Per JLS 9.4.1.2, an error is expected: the default method is override-equivalent with Object.clone, a non-private method of class Object.

            vromero Vicente Arturo Romero Zaldivar
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: