What is the use of printStackTrace() method in Java?

后端 未结 10 1805
不知归路
不知归路 2020-12-02 06:35

I am going through a socket program. In it, printStackTrace is called on the IOException object in the catch block.
What does printStackT

10条回答
  •  温柔的废话
    2020-12-02 07:05

    See image here

    printStackTrace() tells at what line you are getting error any why are you getting error.

    Example:

     java.lang.ArithmeticException: / by zero
        at MinNumber.main(MinNumber.java:8) 
    

提交回复
热议问题