24" oc the walls are fine.. It can be done for the rafters too but it will depend on the pitch you put on it. Especially if you have any amount of weight such as winter snow.. Floor joist is a big no no with 2x4 and 24" oc.
2x10 or 2x12 for joists 24" oc and with a 1" subfloor to prevent sag between the joists.. Better of going 16" oc on the floor to prevent sag between the joists.. Most important is to check local building codes to protect yourself.. GL
If your roof trusses are @ 16" centers, at least the walls that support them, the side walls, should be @ 16" centers.
I'm building a workshed that will be 12x16ft. 7/16 OSB sheathing. I was going to use 24" on the floor joists anyways. Do you should it would effect anything to any great extend by changing the wall stud span from 16" o.c. to 24" o.c., as well as the rafters? Not only will it save time and money, but less heat transfer through the studs. But I am not too experienced in this, so I'm worried it might cause structural failure. Most likely not, but I'd like to know what others think first.