Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Optional;
- public class A {
- public static void main(String[] args) {
- Optional<String> aaaOptinal = Optional.ofNullable("aaa");
- aaaOptinal.ifPresent(aaa -> {
- try {
- hoge();
- } catch (HogeExeption e) {
- String hoge = null;
- hoge.length();
- } catch (Throwable e) {
- System.out.println("ここにはこない!");
- }
- });
- }
- public static void hoge() throws HogeExeption {
- throw new HogeExeption();
- }
- }
- public class HogeExeption extends Exception {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement