플리드 avatar

일곱번째 개발일지

a991102

Published: 20 Mar 2018 › Updated: 20 Mar 2018일곱번째 개발일지

일곱번째 개발일지

안녕하세요 #a991102 입니다.
오늘은 시간이 늦은 관계로 이론은 설명못드릴것 같습니다 ㅠㅠ
나중에는 이론도 같이 가져오겠습니다.

package ;

public class CardTest {
    public static void main(String args[]) {
        System.out.println("Card.width =" + Card.width);
        System.out.println("Card.height=" + Card.height);
        
        Card c1 = new Card();
        c1.kind = "Heart";
        c1.number = 7;
        
        Card c2 = new Card();
        c2.kind = "Space";
        c2.number = 4;
        
        System.out.println("c1 은 " + c1.kind + "," + c1.number
                    +"이며, 크기는 ("+ c1.width +"," +c1.height +")");
        System.out.println("c2 은 " + c2.kind + "," + c2.number
                +"이며, 크기는 ("+ c2.width +"," +c2.height +")");
        
        System.out.println("c1의  width와 height 를 각각 50, 80으로 변경합니다");
        c1.width = 50;
        c1.height = 80;
        
        System.out.println("c1 은 " + c1.kind + "," + c1.number
                +"이며, 크기는 ("+ c2.width +"," +c2.height +")");
        System.out.println("c2 은 " + c2.kind + "," + c2.number
                +"이며, 크기는 ("+ c2.width +"," +c2.height +")");
        
        
    }
}

class Card {
        String kind;
        int number;
        static int width = 100;
        static int height = 250;
}

이상입니다 !


package ;

public class ReferenceParamEx2 {
    public static void main(String args[]) {
        
            int [] x = {10};
            System.out.println("main () : x =" + x[0]);
            
            change(x);
            System.out.println("After change(x)");
            System.out.println("main() : x ="  + x[0]);
            
    }
    static void change(int[] x){
            x[0] = 1000;
            System.out.println("change(): x=" + x[0]);
    }
}

Leave 일곱번째 개발일지 to:

Written by

행복한사람

Read more #kr posts


Best Posts From 플리드

We have not curated any of a991102's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From 플리드