zoukankan      html  css  js  c++  java
  • 使用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";
    }
    
  • 相关阅读:
    sphinx安装
    如何获取原生数据
    DOM详解
    JavaScript简单入门(补充篇)
    JavaScript的简单入门
    Java正则表达式练习
    Java反射机制(Reflect)解析
    21070118记
    CSS3设置Table奇数行和偶数行样式
    获取当前地址
  • 原文地址:https://www.cnblogs.com/afraidToForget/p/7995607.html
Copyright © 2011-2022 走看看