วันพุธที่ 4 กรกฎาคม พ.ศ. 2550

เรียนในสัปดาห์ที่ 3

เรียนรู้เกี่ยวกับคำสั่ง args
รูปแบบคำสั่ง คือ
public class test{
public static void main(String [] args){
System.out.println("Hello!"+" "+args[0]);
}
}

วิธีการ Run
1.compile program ใน cmd
2.Run โดยการเริ่มโดย java test 115
ผลลัพธ์ของโปรแกรม คือ Hello 115 โดยที่ 115 เป็นลักษณะของข้อมูล String