How many ways could a game be developed?

Sorry if this is a stupid question, I’ve been away from programming for a while and just got back into it.

I’m interested is there more than one way a game like pong for example could be programmed? or would it always be near enough 95% the same code (methods, libraries etc)… Excluding named variables of course hence the 95% . Lets say if it was a pong to be developed using JFrame…

Basically would there be a number of ways to code it to do that job of the classic pong? or even space invaders, tetris etc

I’d be interested to hear some feedback on this from the pros to help with my learning & confidence carrying on

I’ve also posted this question before in another java forum (not java gaming) but that was more for software, I’m interested to see what the experts have to say on here…

Thanks