Show him an alternate thing - that is okay to throw -- even inside.. For example: We had a soft ball that wouldn't hurt anything... and that was okay to throw (inside). Since we live where it's snowy most of the year, it wasn't feasible to only have throwing outside when trying to show an altertative/positive.
I took away all toys that my son threw and put them within eye sight (we had a stuff animal hammock that worked wonderfully). It seems harder, since it's not just toys and you can't take away cups and such.. but hopefully, the no throwing (of toys) carries over.
As for hitting.. again, I got something that was okay to hit.... One of those bop punching bags... Pillows in his bedroom...
If your child is throwing anything in the car.. then they should not have access to ANYTHING they can throw. That creates a safety hazard. Tell him: I can't give you X, because you choose to throw things. Once your child stops throwing things in the house... pre-teach... "I will give you this because you've been making good choices.. but if you throw it, you will loose it"
I believe in one chance only with hitting or anything having to deal with safety. I preach it often... be consistent so your child knows what to expect! :-)