Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

InterfaceConstructor.java 353B

123456789101112131415161718
  1. interface I { }
  2. public class InterfaceConstructor implements I {
  3. public static void main(String[] args) {
  4. new InterfaceConstructor();
  5. }
  6. }
  7. aspect NoSuchJP {
  8. before(): execution(I.new(..)) { // error expected
  9. // No constructor-execution on interface type
  10. }
  11. before(): execution(I+.new(..)) { // no error
  12. // This is OK, as there is a +
  13. }
  14. }