The article a/an is a determiner (NOT PARTICULAR), as defined by Cambridge Dictionary. There are many definitions but the first one will do. "Used before a noun to refer to a single thing or person that has not been mentioned before, especially when you are not referring to a particular thing or person."
In your example, "class 2" IS a particular thing or person; thing, in this case. Hence, it doesn't need the article "a".
"The" is also a determiner, but PARTICULAR, according to the same dictionary, "used before nouns to refer to particular things or people that have already been talked about or are already known or that are in a situation where it is clear what is happening". When someone says "We are in the classroom", the noun referred has already been mentioned or is already known.
Syl's English Corner - Learn English and Have Funhttp://www.ginnegar.0catch.com