Skip to Content
자바에서 코틀린으로
book

자바에서 코틀린으로

by 덩컨 맥그레거, 냇 프라이스, 오현석
November 2022
Beginner to intermediate
544 pages
12h 39m
Korean
Hanbit Media, Inc.
Content preview from 자바에서 코틀린으로
425
19
예외 던지기에서 값 반환으로
);
assertEquals(
new Customer(“0”, “fred flintstone”, “fred@bedrock.com”),
added
);
assertEquals(added, customers.find(“0”).orElseThrow());
}
@Test
public void throws_DuplicateException_when_email_address_exists() {
customers.add(new Customer(“0”, “fred flintstone”, “fred@bedrock.com”));
assertEquals(1, customers.size());
assertThrows(DuplicateException.class,
() -> registration.register(
new RegistrationData(“another name”, “fred@bedrock.com”)
)
);
assertEquals(1, customers.size());
}
...
}
이런 방식이
register
registerToo
를 둘 다 유지하면서 자바와 예외로부터 코틀린과 오
류를 표현하는 타입으로 마이그레이션을 수행하는 좋은 방법일 것이다. 하지만 여기서는 테스
트가 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

고성능 파이썬(2판)

고성능 파이썬(2판)

오현석, 미샤 고렐릭, 이안 오스발트
러닝 타입스크립트

러닝 타입스크립트

조시 골드버그
실리콘밸리 리더십

실리콘밸리 리더십

김정혜, 마이클 롭

Publisher Resources

ISBN: 9791169210447