Exception.getCause() returning null when trying to find the source of an exception

后端 未结 3 534
隐瞒了意图╮
隐瞒了意图╮ 2021-01-01 03:26

why does System.out.println(e.getCause()); gives null? And can store whole HashSet collection like this?

private void saving() thro         


        
3条回答
  •  死守一世寂寞
    2021-01-01 04:12

    Use printStackTrace() instead of getCause().

    And yes, you can save a whole collection (as long as it holds objects that implement Serilizable).

提交回复
热议问题