I have a doubt which follows.
public static void main(String[] args) throws IOException{ int number=1; System.out.println(\"M\"+number+1); }
It has to do with the precedence order in which java concatenates the String,
Basically Java is saying
"M"+number = "M1"
"M1"+1 = "M11"
You can overload the precedence just like you do with maths
"M"+(number+1)
This now reads
"M"+(1+1)
"M"+2
"M2"