0

以下语句的 Java 等效指令是什么:

String name;
cout << "So your name is  " << name << endl;  

或者在 C# 中

console.writeline("So your name is {0} ", name);
4

1 回答 1

5
String name;
cout<<"So your name is  "<<name<<endl; 

相当于:

String name = ...;
System.out.println("So your name is " + name);

和:

Console.WriteLine("So your name is {0}", name);

相当于:

System.out.printf("So your name is %s", name);
于 2012-12-26T23:16:55.257 回答