Skip to content

배열 선언과 할당을 분리할 때 리터럴로 사용하면 컴파일 오류가 나는 이유 #2

@nuheajiohc

Description

@nuheajiohc
int[] arr1;
arr1 = {1, 2, 3, 4, 5};   //컴파일 오류

int[] arr2;
arr2 = new int[]{1, 2, 3, 4, 5};

Metadata

Metadata

Assignees

Labels

Deep Dive더 깊이 알아볼 내용, 공부해 볼 내용Java

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions