public class MainClass
{/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
System.out.printf("%d\n",45+56);}}
在命令行和netbean5中编译通过,但在Eclipse3.1中得到下列Error Message
The method printf(String, Object[]) in the type PrintStream is not applicable for the argument (String, int)请有识之士不吝赐教。这里先谢过了。
{/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
System.out.printf("%d\n",45+56);}}
在命令行和netbean5中编译通过,但在Eclipse3.1中得到下列Error Message
The method printf(String, Object[]) in the type PrintStream is not applicable for the argument (String, int)请有识之士不吝赐教。这里先谢过了。
java没这种写法的。
用System.out.println(45+56),换行输出
不换行的是System.out.print(45+56)
把C语言的printf()函数玩出来了