This answer is going to assume that your question ultimately expands to be:
How do I tell the difference between the ordinal and the unit of time?
Answer: context.
Both the ordinal and the unit of time can be referred to using either article (the definite the or the indefinite a), so that's not going to help.
Commonly, when referring to the ordinal second, you'll see it describing something else:
- The second car has crossed the finished line.
- A second racer has crashed into the wall!
- The competitor must score a second perfect to advance...
- This is now the second time that the racer has earned second place.
Adding to the confusion, the ordinal can refer to "prize" or "place" without adding those additional words and still be valid English:
- Prize
- The second prize goes to Nutley.
- Second goes to Nutley.
- Place
- James lost to King, earning a second place finish.
- James lost to King, earning second.
However, you'll commonly see ordinals with other ordinals:
- I had no idea the car could have leapt from fifth to second!
- That puts Mary in first, Jesse in second, and King in third...
- First, we break into the bank. Second, we loot the bank. Third, we all get arrested...
When second is being used as a unit of time, they'll have a context relating to time:
- I'll be with you in a second.
- I'll fire the second I see it move.
- The second the item goes on sale, I'm buying it.
- A second isn't much time to react.
Just to reiterate, the context is what will tell you one way or the other, and why writing grammatically correct English can be very important. Take the following terse sentence, do you know what they mean?
That's the second second! Wait, do we have a second second too?
- Is the speaker talking about about two seconds of time?
- Is the speaker incredulous at a competitor earning two second-place finishes?
- Is the speaker confused about there being more than one person earning second-place?
Without that context you just don't know!
Your question:
Is it really grammatically correct to say what kind of an animal instead of what kind of animal...?
Yes, it is. It is possible to keep an, though it's fair that you'd expect it dropped because it's usually dropped. Then again, it's quite obvious that his writing style is informal.
This entry of Practical English Usage by Michael Swan should help explain why both alternatives (with or without a/an) are possible.
551 sort of, kind of and type of
1 articles
The article a/an is usually dropped after sort of, kind of and type of, but structures with articles are possible in an informal style.
That's a funny sort of (a) car.
What sort of (a) bird is that?
So, if it were:
If you already know what kind of animal Java is and know that you want to use Java, skip Chapter 1 and go straight to Chapter 2. Believe me, I won’t mind.
would the meaning be different?
Not at all (to put it simply), because in his usage, what kind of animal would mean the same thing as his what kind of an animal.
Best Answer
This is a subtle distinction in this instance.
In English, generally, you use the article "the" when referring to a unique entity in the world, one that is typically already known to the audience.
If you're in a country with a prime minister, it's assumed that the prime minister is the one who leads your country. There is only one of them, and they are already known. In America (which has a president) you could not say that sentence without first mentioning what country the PM is from or which prime minister you mean.
or
But what about your example?
Although theoretically there can only be one second example, there could actually be more than one.
As long as the animal sent to London is the second of that animal in London, and the animal sent to Paris is the second of that animal in Paris, there can be two second examples.
If you use "the second example", you are then saying that this is the one and only of that animal that is considered a second example in the context of this story. If you say "a second example", you are saying there could be other second examples in the context of the story, like a second example sent elsewhere.