JAVA/6. Object2
오브젝트 예제 1
날아올라↗↗
2016. 6. 22. 17:12
728x90
반응형
- package test.com;
- public class Test01AAA {
- private int x;
- String y;
- public int[] xs;
- protected String[] ys;
- }
- package test.com;
- public class Test01Main {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- System.out.println("main...");
- // Test01AAA ta01 = new Test01AAA();
- // System.out.println(ta01);
- //
- // ta01 = new Test01AAA();
- // System.out.println(ta01);
- //
- // Test01AAA ta02 = new Test01AAA();
- // System.out.println(ta02);
- //ex : int[] sus = new int[10];
- Test01AAA[] tas = new Test01AAA[10];
- for (int i = 0; i < 10; i++) {
- Test01AAA ta01 = new Test01AAA();
- System.out.println(ta01);
- tas[i] = ta01;
- }
- System.out.println();
- for (int i = 0; i < tas.length; i++) {
- System.out.println(tas[i]);
- }
- } //end main
- } //end class
728x90
반응형