Jini's Blog

Ing...

  • Home
  • Business
    • Internet
    • Market
    • Stock
  • Parent Category
    • Child Category 1
      • Sub Child Category 1
      • Sub Child Category 2
      • Sub Child Category 3
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Featured
  • Health
    • Childcare
    • Doctors
  • Home
  • Business
    • Internet
    • Market
    • Stock
  • Downloads
    • Dvd
    • Games
    • Software
      • Office
  • Parent Category
    • Child Category 1
      • Sub Child Category 1
      • Sub Child Category 2
      • Sub Child Category 3
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Featured
  • Health
    • Childcare
    • Doctors
  • Uncategorized

Java 버전별 특징 및 변경사항

 Jini     오후 10:28     JAVA     No comments   

1. Java7

• 타입추론

List<String> list = new ArrayList<>();

• 이진수 리터럴, 숫자 리터럴에 _ 지원

• Switch문 문자열 가능

• try-with-resources 문 : AutoCloseable 인터페이스를 구현하는 클래스에 속하는 경우 다음과 같은 코드 패턴에 대한 단축 기능을 제공한다.

//JAVA 7 이전
//리소스를 연다
try {
    리소스를 이용해 작업한다.
}
finally {
    리소스를 닫는다.
}

//JAVA 7 이후
try (Resource res = ...) {
    res를 이용해 작업한다.
}

//여러 리소스를 지정할 수 있다.
try (Scanner in = new Scanner(Paths.get("/usr/share/dict/words"));
      PrintWriter out = new PrintWriter("/tmp/out.txt")) {
    while (in.hasNext()) {
      out.println(in.next().toLowerCase());
    }
}

• 여러 예외 잡기


try {
  //예외를 던질 수 있는 코드
}
catch (FileNotFoundException | UnknownHostException ex) {
  //파일 누락 및 알려지지 않은 호스트에 대한 긴급 액션
}
catch (IOException ex) {
  //그 외의 모든 I/O 문제에 대한 긴급 액션
}

2. Java8

• 32비트를 지원하는 마지막 공식 버전

• Lambda

• Stream

• Default Method

• LocalDate, LocalTime

• Optional


3. Java9

• default GC : G1GC

• Module System

• Collections of(불변)

List<String> list1 = List.of("a", "b");

• Jshell 추가

• try-with-resources 향상

// try() block 밖에 선언된 변수에 대해서는 try-with-resources 사용불가능했으나 java9부터 가능
// BufferedReader is declared outside try() block
BufferedReader br = new BufferedReader(new FileReader("C://readfile/input.txt"));

// Java 9 make it simple
try (br) {
    String line;
    while (null != (line = br.readLine())) {
        // processing each line of file
        System.out.println(line);
    }
} catch (IOException e) {
    e.printStackTrace();
}

• 인터페이스에 private 메소드 사용가능


4. Java10

• var 사용가능

• JVM 힙 영역을 시스템 메모리가 아닌 다른 종류의 메모리에도 할당 할 수 있게 되었다.


5. Java11

• 새로운 가비지 컬렉터 등장 : ZGC, Epsilon

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
이메일로 전송BlogThis!X에 공유Facebook에서 공유
최근 게시물 이전 게시물 홈

0 Comments:

댓글 쓰기

Popular Posts

  • 한글이 3byte인 경우 캐릭터셋 확인
    오라클의 문자집합이 KO16KSC5601, KO16MSWIN949 인 경우는 2 Byte로 한글을 인식. UTF8/AL32UTF8의 경우 3Byte로 한글을 인식. 단 UTF8/AL32UTF8의 경우는 한글 정렬이 가능하다는 장점이 있다. 캐릭...
  • 문법에서 문장까지(대명사)
    1. 대명사 ■ 인칭대명사 1) 대명사는 숙어 동사(phrasal verb) 사이에 쓴다. * I cut up half of one large banana and put it in cereal. 2) 소유격 대명사와 관사는 같이 쓸 수 ...
  • Redmine Text Format
    1. 글자색상 변경 %{color:red}dev% 2. 음영색상 변경 %{background:lightgreen} lightgreen% 3. 문단 넘버링(띄어쓰기 주의) # 큰 제목 ## 큰제목의 하위 제목 # 두번째 큰 제목 # ...
  • 오라클 한글깨짐 현상해결
    1. 레지스트리 편집기 실행 : 시작 -> 실행 -> regedit 2. HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 하위 경로 폴더중 이름이 "NLS_LANG"인 속성의 데이터 확인 3. "...
  • Visual Studio 2013 팁 및 단축키(이클립스랑 비교)
    이클립스에는 있는데 VS에는 없어서 있었으면 하는 기능 중 실제로 있었는데 내가 몰랐던 것들 1. 한 줄 삭제 이클립스는 ctrl + d / VS는 ctrl + shift + l 2. 한 줄 그대로 복사하여 아래로 붙여넣기(위로 붙여넣기는 모...

Recent Posts

Recent Posts Widget

Blog Archive

  • ►  2023 (4)
    • ►  3월 (1)
    • ►  2월 (1)
    • ►  1월 (2)
  • ►  2022 (1)
    • ►  2월 (1)
  • ▼  2020 (8)
    • ▼  7월 (1)
      • Java 버전별 특징 및 변경사항
    • ►  4월 (3)
    • ►  3월 (4)
  • ►  2018 (1)
    • ►  7월 (1)
  • ►  2015 (1)
    • ►  5월 (1)
  • ►  2014 (5)
    • ►  8월 (1)
    • ►  7월 (1)
    • ►  6월 (1)
    • ►  5월 (1)
    • ►  1월 (1)
  • ►  2013 (10)
    • ►  12월 (1)
    • ►  11월 (1)
    • ►  9월 (2)
    • ►  8월 (3)
    • ►  7월 (3)
  • ►  2012 (1)
    • ►  3월 (1)

Categories

  • 객체지향 (1)
  • 도서요약 (1)
  • 문법에서 문장까지 (2)
  • 일상 (1)
  • 자기계발 (1)
  • 책 (1)
  • 키보드 (1)
  • 키크론 (1)
  • blogspot (2)
  • error (1)
  • exception (1)
  • GIT (1)
  • JAVA (6)
  • JUNIT (1)
  • K8 PRO RGB (1)
  • kafka (1)
  • markdown (1)
  • mongodb (2)
  • mongotemplate (1)
  • optional (1)
  • Oracle (4)
  • Redmine (1)
  • spring (1)
  • stackedit (1)
  • troubleshooting (1)
  • Visual Studio (1)
  • Webflux (1)

Unordered List

Pages

  • 홈

Text Widget

Categories

Tags

Facebook

  • Home
  • Features
  • _Multi DropDown
  • __DropDown 1
  • __DropDown 2
  • __DropDown 3
  • _ShortCodes
  • _SiteMap
  • _Error Page
  • Documentation
  • Video Documentation
  • Download This Template

Footer Menu Widget

  • Home
  • About
  • Contact Us

Social Plugin

JINI. Powered by Blogger.

Copyright © Jini's Blog | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates