A: Boy, was that class boring!
B: Sure was.
As you can see sentence 'a' is not a question. So why 'was' is the first word in the sentence?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.
Sign up to join this communityI guess this could be considered a class of exclamatory question. In particular, there's a common construction that takes the structure of a question but uses it as an exclamation, with an assumed meaning of "yes" to the question.
A common stand-up-comedy joke is "I just flew in from [some other city], and boy, are my arms tired!" It doesn't really mean to ask a question at all—it's not asking "are my arms tired?"; in fact, this construction emphasizes that the statement is certain.
It's related to some other exclamatory-question structures, like "Isn't she lovely!", but a little different: Isn't she lovely means "Is she not lovely"; many exclamatory questions include a negative like that. "Won't it be great?" "Haven't you heard?" But the construction in this example uses a positive question; it also often includes an intensifying word or phrase like "Boy!," "Man!," "Oh my," etc.
Other examples:
This particular word order is idiomatic/natural in English. All you need to know is learn what it means:
Boy, was that class boring! = Boy, what a boring class it was!
Here's another example:
Boy, was the movie interesting! = Boy, what an interesting movie it was!