When teachers introduce themselves to a new class, it is like an introduction to the whole year, term or however long the teacher will be teaching this class for. As such, the teacher will need to leave an impression on the students, showing the students what sort of teacher they get for the term (or year or etc.). With this in mind, the first thing the teacher must do is decide what sort of teacher they want to be, i.e. a strict no-nonsense teacher, a fun likeable teacher, or one who's strict but still with a sense of humour? Its up to the teacher to decide. Once they've decided this, they can then find out how to best introduce themselves to their class in a way that subtly emphasises the kind of teacher they are. (Bear in mind, the age of the class you are taking can also affect how to introduce yourself.)
As an example, I'm going to explain how a fun likeable teacher might introduce themselves to a class in middle or high school. First off, you might find that bringing a small rubber ball or something else that can be lightly thrown to students a good idea. When you enter the classroom, do NOT just walk in and write your name on the board. This is lame. When the students see this, the first thing they see is someone who's just going to write notes down for them to copy all year long. This is not what a fun teacher is going to do, and so by writing your name on the board, you just let yourself down for dissapointment. Now we come to the ball that I mentioned earlier. Once you've entered the classroom (assuming that your students were already there, I'll cover what to do if they aren't later), walk to your desk saying your name, i.e. "Hi, I'm (Mr/Mrs/Ms etc.) (Your name)". Then, explain that for the first lesson you won't be the one teaching them, but they'll be the ones teaching you, mainly, their names. Ask them to arrange themselves in a circle (if the space of the room allows for this), and if not then to stand up and spread out as much as possible, so that they can still see each other. Then, ask them to each just say their name and you just need to try and remember one of them for now. Then, throw the ball to them after saying "(Your name) to (their name)". As each person catches the ball, they must then pass it to another person by saying the same as you said (with their name and the name of the person they are passing the ball to). This way, you can not only learn the names of your students and so appear more friendly and familiar with them, but you can also show them that although you are their teacher, you still hope to have some fun with them.
As I said above, if you are in the classroom before your new class, there is no need to panic. All you need to do is as each student walks in, invite them to sit wherever they want and that they are free to talk among themselves until everyone is seated and ready. If any students come in late, you can and should tell them that next time they should make more of an effort to get there on time, but try not to be scolding, make it more of an "OK, you were late. Don't do it again." then move on with the lesson. Once everyone is in class and comfortable (while trying not to take too long waiting for everyone to be ready, as this can make you seem like a pushover), then begin with the excercise mentioned above.
This method is to help teachers become familiar with their class and for the class to realise that their new teacher is actually friendly and might make the lessons fun while still teaching the students what they need to learn. For teachers who do not want to be seen as a fun-loving and friendly teacher, then you can either find a way to introduce yourself in the way that you want, or just write your name on the board for the class to see when they walk in. (Bear in mind that while many students prefer the fun, there is always some who want a strict teacher who can control the more energetic of the class).