Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Java equivalent to printing values in C#?

Tags:

In C#, I can say:

 int myInt = 10;
 int myInt2 = 20;
 Console.WriteLine("My Integer equals {0}, and the other one equals {1}", myInt, myInt2);

And I know how to print things in Java like this:

 int myInt = 10;
 System.out.println("My Integer equals " + myInt);

So how do I combine the two so that in Java, I can print multiple values just like I would in C#?