`

Cannot reduce the visibility of the inherited method from Father

    博客分类:
  • java
阅读更多

有如下两个类

 

Father 类:

public class Father {
	public  void f() {     
        System.out.println("Father.f()");
     }
}

 

 Son类:

public class Son extends Father{

     private final void f() {     //这里会出现编译错误 Cannot reduce the visibility of the inherited method from Father
         System.out.println("Son.f()");
     }
	
	void test() {
        f();
     }
	
	 public static void main(String[] a) {
         new Son().test();
       
     }

}

 出现上面错误的原因是因为如果子类要覆盖了父类中定义的方法,那么不能降低其可见性

所以修改子类的修改符即可

分享到:
评论

相关推荐

    Method for enhancing visibility of hazy images based on polarimetric imaging

    It is found that the dehazed image suffers from little noise and the details of the objects close to the observer can be preserved well. In addition, this algorithm is also proved to be useful for ...

    Coherent Hierarchical Culling:Hardware Occlusion Queries Made Useful

    Our method minimizes the number of issued queries and reduces the delays due to the latency of query results. We reuse the results of occlusion queries from the last frame in order to initiate and ...

    The A-buffer, an Antialiased Hidden Surface Method (1984)

    It resolves visibility among an arbitrary collection of opaque, transparent, and intersecting objects. Using an easy to compute Fourier window (box flter), it increases the effective image resolution...

    VisibilityGraphMotifs-master.zip_The Master_visibility graph

    depicts the visibility graph motifs in 4 nodes

    Internet of Things (IoT)-CRC(2018).pdf

    tinting lms from the gray market and pastes the same on the glass windows, which in turn hamper the visibility, thereby preventing the law enforcement authorities from having a clear view of those ...

    不良气象微环境对机场道面抗滑性能影响分析.docx

    environment, and the adverse weather conditions such as precipitation, ice, and low visibility seriously affect the safety operation of airport traffic. Therefore, it is necessary to study the impact ...

    SCWCD-model1.pdf

    However, based on the pattern of the questions, we can infer that this question might test the understanding of another aspect of Java, such as method overriding, method overloading, or anonymous ...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    Based on the provided information from the book "C# 3.0 With the .NET Framework 3.5 Unleashed," we can extract several key points and concepts that are essential for understanding the fundamentals of ...

    数位板压力测试

    The design presented here is based on the input of numerous professionals from the pointing device manufacturing and Windows soft¬ware development industries. In this document, the words "tablet" ...

    3DVIA Composer V6R2014

    video and interactive 3D material, which not only improve the perception of information through greater visibility, but and greatly improve the quality of the generated documentation. Using ...

    Kanban for the Shopfloor

    - **When to Produce**: Production is triggered by the withdrawal of items from downstream processes. - **What to Replenish**: Decisions are made based on what has been consumed. - **When to Pull**: ...

    【船级社】 NK Rules for the Survey and Construction of Steel Ships _

    【船级社】 NK Rules for the Survey and Construction of Steel Ships _ Guidance Part W NAVIGATION BRIDGE VISIBILITY.pdf

    Artificial Intelligence and Computer Vision

    common images, underwater images suffer from poor visibility due to the mediumscattering and light distortion. First of all, capturing images underwater are difficult, mostly due to attenuation caused...

    DevExpress VCL 13.2.5 D7-DXE6 FullSource

    •Q581933 - At design time, modifying any property of a control selected on the parent form selects a control on an inherited form if the parent form contains TdxWizardControl and/or ...

    Visibility_in_Bad_Weather_from_A_Single_Image

    ### 基于单张图像的恶劣天气下能见度增强技术 #### 概述 在计算机视觉领域,恶劣天气条件如雾、霾等对场景可见性的显著降解是一个重大挑战。这种现象从光学角度来看,主要是由于大气中存在的大量粒子吸收和散射...

    VIsibility属性

    VISIBILITY属性详解 在 Android 开发中,控件的可见性是非常重要的,VISIBILITY 属性就是控制控件的显示和隐藏的。通过设置 VISIBILITY 属性,我们可以控制控件的可见性,达到不同的显示效果。 VISIBLE、INVISIBLE...

    AT070TN82 V1

    This measurement refers to the distance from one corner of the screen to the opposite corner, passing through the center of the screen. 2. **Driver Element**: The display uses amorphous silicon (a-...

Global site tag (gtag.js) - Google Analytics