Package Nuaa; Public Class XXX {Public Int A; Private XXX (INT A) {THIS.A = A; System.out.Println ("this.a =" this.a);} / * public static void main String [] args) {xxx duixiang = new xxx (68); int A = 5; system.out.println (duixiang.a a);} * /
}
Package nuaa; public class yanzheng {public static void main (string [] args) {xxx jpu = new xxx (334);}}
The method of the Private Constructor can be instantiated inside the class, and it cannot be instantiated outside the class.