System.out.println()相當於c語言中的函數
但是它在java中並不能用函數來定義
System相當於在Java中的一個類,而out是一個static PrintStream對象,println就是方法
查看Java中的類和對象
public class inputone {
public static void main(String args[]){
System.out.println("hello world");//可以直接輸出字符串,中間用雙引號
}
}
public class inputone{
public static void main(String args[]){
int a=9;//整形
String str="hello world";//定義一個字符串
System.out.println(a+"\n");//輸出變量時不需要雙引號,+號可以使字符串進行拼接
}