Skip to content

Instantly share code, notes, and snippets.

@youngjinmo
Last active January 12, 2021 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youngjinmo/78581da7fe7027012de7e9d23934428c to your computer and use it in GitHub Desktop.
Save youngjinmo/78581da7fe7027012de7e9d23934428c to your computer and use it in GitHub Desktop.
백선장님 라이브 스터디 2주차 과제 예제 코드
public class StudyHaleEx01 {
public static void main(String[] args) {
StudyHale02 study = new StudyHale02();
int[] arr = new int[10];
// 타입 추론
var typeInference01 = "greeting";
var typeInference02 = arr;
var typeInference03 = study;
var typeInference04 = study.greeting;
System.out.println(typeInference01.getClass().getSimpleName());
System.out.println(typeInference02.getClass().getSimpleName());
System.out.println(typeInference03.getClass().getSimpleName());
System.out.println(typeInference04.getClass().getSimpleName());
}
}
public class StudyHale02 {
String greeting = "hello";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment