Adding materials to multiple objects

Is there a way to select a bunch of object and add a material to all of the select objects?

I’m working on a project and I just made about 30 cubes and placed them. But I never set and materails for them. is there a way to do this now, or do I have to click on each one individually?

Thanks

search forum. i think you assign it to one, the shift-click to select all the others, and select the materialed one last. Then link -> materials.

That’s. I should have thought of that.

Thanks