使用java

1,  implicit super constructor {SuperName}() is undefined for default constructor.Must define an explicit constructor.

Implicit super constructor {SuperName}() is undefined. Must explicitly invoke another constructor.

Java的构造函数不能继承,所有的构造函数隐式调用父类的无参函数。

如果父类没有无参构造函数,子类必须显示定义构造函数同时显示调用父类的构造函数。

2 注解的作用:每当你创建描述符性质的类或者接口时,一旦其中包含重复性的工作,就可以考虑使用注解来简化与自动化该过程。

https://www.zhihu.com/question/36486629

!!!同时使用注解和反射

package com.test;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

//@Documented
@Inherited //子类继承注解
@Retention(RetentionPolicy.RUNTIME) // 生命周期
@Target(ElementType.CONSTRUCTOR) // 目标类型
public @interface At {
	String name()default "nothing";
}
原文地址:https://www.cnblogs.com/afraidToForget/p/7995607.html