check if 'way' is fit to cars

I wrote a Java code that iterates over each entity from an OSM XML file.
I want to filter ways depending on if they are fitting for cars.
My problem is that there are too many tags (“trunk”, “motorway”, “pedestrian”, “footway”, “bridleway”, “steps” etc…)

Is there a list of tags that are good for cars I can use?
Is there an easier way to do it without iterating over each way tags?

thanks!

Hi, for the list of relevant values our wiki is a good resource: https://wiki.openstreetmap.org/wiki/Key:highway .

As for your Java code: that’s a language I don’t know. But if possible I’d use something like

value=in("motorway","trunk",etc)

There is no simple rule reg. the importance of a road that is given with the highway=* tag and the vehicles which may access it. The java program mkgmap requires several rules to decide that.
See https://wiki.openstreetmap.org/wiki/Key:access#Transport_mode_restrictions