13
Because I can’t extend classes with private builder?
Consindo the classes To:
public class A {
private A(){}
public static void limao(){}
}
and B:
public class B extends A {
private B(){}
public static void banana(){}
}
Why B can’t extend To?
There is no default constructor available my.package.name. A
My goal is to have some classes that contain only static members and I would like to ensure that they are used in the correct way (without instances) but also inherit from other classes because they have common methods. I currently do this in C# through static classes but I can’t apply something like this to my Android project.
As far as I know proteced is an access modifier that makes visible the class and/or attribute for all other classes and subclasses THAT BELONG TO THE SAME PACKAGE. Edit: Source http://docs.oracle.com/javase/tutorial/javaO/accesscontrol.html
– Clebao
In this case it is not worth changing the answer, because the question of the package is Java’s own, and I explained talking about the general theory of object orientation.
– Leonel Sanches da Silva