More actions
imported>miura0806 No edit summary |
imported>miura0806 No edit summary |
||
| Line 32: | Line 32: | ||
단, 이 경우에는 선언과 생성을 동시에 할 경우에만. | 단, 이 경우에는 선언과 생성을 동시에 할 경우에만. | ||
먼저 선언을 했을 경우에는 (int[] arr;) arr = new int[]{1, 2, 3, 4, 5}; | 먼저 선언을 했을 경우에는 (int[] arr;) arr = new int[]{1, 2, 3, 4, 5}; | ||
* 생성 후 크기 변경도 가능. | |||
int[] arr; | |||
arr = new int[3]; | |||
arr = new int[5]; | |||
→ 문제없음. | |||
== 다음 진행 == | == 다음 진행 == | ||
* Chapter 6 | * Chapter 6 | ||
Revision as of 03:22, 9 July 2014
일시
- 오후 12시 15분 ~
참가자
| 유재범 | 불참 |
| 최다인 | 참석 |
| 이지수 | 참석 |
| 김용준 | 불참 |
| 김정민 | 참석 |
진행 상황
- 김정민 학우의 발표
- Java의 정석 - Chapter 5
발표 내용
- C에서의 배열은 선언과 생성이 동시에 되나, Java에서는 선언과 생성이 다름.
int[] arr; : 선언
arr = new int[5]; : 생성
int[] arr = new int[5]; : 선언과 생성, 동시에.
자동으로 0으로 초기화
int[] arr = {1, 2, 3, 4, 5}; 이런 형식도 가능.
단, 이 경우에는 선언과 생성을 동시에 할 경우에만.
먼저 선언을 했을 경우에는 (int[] arr;) arr = new int[]{1, 2, 3, 4, 5};
- 생성 후 크기 변경도 가능.
int[] arr; arr = new int[3]; arr = new int[5]; → 문제없음.
다음 진행
- Chapter 6
- 객체지향 프로그래밍 1
- 발표 : 최다인