Both can be used interchangeably.
"adet" on the other hand, indicates numbers. There is no difference in meaning in the example you provided, but the term 'adet' is most commonly used in sales, for example, 24gr. 24 adet çikolata, where the word 'tane' is not used.
There is also another word called âdet (with circumflex), it can be perplexing as 'âdet' and 'adet' have different connotations.