Is it possible to have both a class A and a class B network on the same switch?
Classful networking has been replaced by CIDR (Classless Inter-Domain Routing). So a more generic form of your question is "Is it okay to have two subnets on the same switch?". The answer to this is in this question (But the summary is that it is okay).
I recommend you spend some time reading Evan's answer to this question, as it is a great overview of subnetting.