Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class C {
- public static C[] x;
- static {
- x = new C[10];
- for (int i = 0; i < x.length; ++i) {
- x[i] = new C("name" + i);
- }
- }
- public static void main(String[] args) {
- for (final C e: C.x) {
- System.out.println(e.getName());
- }
- }
- private final String name;
- public C(String name) {
- this.name = name;
- }
- public String getName() {
- return name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement