Skip to Main Content

Java SE (Java Platform, Standard Edition)


For appeals, questions and feedback, please email

Problem with protected constructor

Tuan HaAug 22 2017 — edited Aug 22 2017

I have 2 class in 2 package: class ClassOne in package1 and clas ClassTwo in package2. Class ClassTwo extends class ClassOne which have a protected constructor: protected ClassOne(String s). When i call protected constructor of ClassOne in constructor of ClassTwo it get none error but i can see it when do ctrl+space, it just show a public constructor super(). So what is this problem, why IDEs not show protected constructor when i ctrl+space?

package package1;

public class ClassOne {

    public ClassOne(){



    protected ClassOne(String s){




package package2;

import package1.ClassOne;

public class ClassTwo extends ClassOne{

    public ClassTwo(){

        super("Why this protected constructor can use but not visiable?");//i can use this constructor protected ClassOne(String s) but can see it when ctrl+space



Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2017
Added on Aug 22 2017