Generally the default access level of the methods is local package. But I think it is different for public abstract sections; it appears to be the default in those sections, is this right?
Update @EJP
This was a bug in my code, it is possible to shade the package local method with a public method, which confused me I think that a public abstract can be similar to an interface where the methods are public, see examples:
a / ajava: test_a.java: false , watch with a quick example : A quick implementation: Now, in another package: The compiler complains about visibility. Therefore, the default visibility for methods is package protected , even if class < Code> package a; Public abstract class A {String A () {return "A"; }}
class test_a {provides static class newa AA {public string A ()) "New A"; }} Public static zero main (string [] args) {new a = new neue (); Println (a.a ()); }}
package package; A method with public intangible class abstractist {// default visibility summary (zero times); }
Expands public square Fu abstrfo {@Override void bar () {}}
public static zero main (string [] args throws exceptions {tables = something new) some .bar (); // compiler complains here
public abstract
No comments:
Post a Comment