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 に答える