Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在下面的代码行中遇到了一些表达式错误和符号预期错误,但无法弄清楚原因。
System.out.println( "Hourly Rate: " money.format(myEmployee.getHourlyRate() ) );
因为您需要+在 print 语句中连接两个值。
+
System.out.println( "Hourly Rate: " + money.format(myEmployee.getHourlyRate() ) );