What is the meaning of printstacktrace in java?


he message and the stacktrace are two distinct pieces of information. While the stackstrace is mandatory, the message isnt. Most exceptions deliver a message, and it is the best practice, but some just don't and there's nothing to be done to fix it.

public

void

process

()

{

try

{

System

.

out

.

println

(

"test"

);

}

catch

(

Exception

e

)

{

e

.

printStackTrace

();

}

}