Hi, and welcome to the Ranch!
When posting code, please
UseCodeTags(←click) so that it will be readable. I've added them to your post for you this time.
As for your problem, contrary to what you state, that code actually prints two things after the title.
1) It prints the toString() representation of the num array, which is garbage for humans. If you want to print the contents of an array, you need to iterate and print the individual elements one by one, or use java.util.Arrays.toString(). I'd recommend you take the first route for now, for practice.
2) It prints sum, which is 0. Why do you think sum is 0? If you can't figure it out after studying your code for a few minutes, then add a couple more println() calls inside the loop to print out the various intermediate values.