Formal:
* 同学们好! (Tóngxuéshēng hǎo!) - This is the most common and formal way to greet the class. It literally means "Students, good!"
* 大家好! (Dàjiā hǎo!) - This means "Hello everyone!" and can be used in a slightly less formal setting.
Informal:
* 嗨,同学们! (Hài, tóngxuéshēng!) - This is a more casual way to greet the class, similar to "Hey guys!"
For a specific class:
* X班的同学们,大家好! (X bān de tóngxuéshēng, dàjiā hǎo!) - This means "Hello everyone in class X!" Replace X with the actual class number.
Note: The tone and inflection of your voice can also convey formality or informality.