Okay, in order to do a way to track a sequence, you will need to use an array. The problem is, that arrays are pre-set sizes of memory, and resizing them is a relatively annoying process.
On the other hand, you can track just a particular run. The process here involves a simple counter. Here's what you do:
This logic. That way you don't need to dedicate any additional memory.
IF toss IS heads then
SET counter <- counter + 1
SET count <- 0
If you need to record at any time, I'd probably stick with the H/T string (HTHHHHTTTHTH) approach, and then loop that as needed. Its a bit easier than handling an array, but not as easy as using a collection (which I'm guessing you have not covered).
A String in Java is little more than an object wrapper for a char array (its *not*, but its little more than that). Therefore, you can convert a string to a char array, and iterate it character by character. By doing so, you can then count the H sequence, and reset the count when the T is discovered (same logic as above, but now dealing with the char instead of the float/double). String tokenizing is also a relatively useful methodology that's often overlooked.
Are you expected to output in a particular fashion? Do you need to store it in any way?