---
# System prepended metadata

title: IDE

---

```
public class FirstJava {

public static void main(String args[]) {
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    Date date = new Date();
    System.out.println(dateFormat.format(date));

    String path = System.getenv("PATH");
    System.out.println(path);

    System.out.println("param1 = " + args[0]);
}
}

```
# Trace & Debug
```
public class Shape {

public static void main(String[] args) {

boolean flag = true;
Scanner s = new Scanner(System.in);
while(flag) {
System.out.println("請輸入數字以印出2對應形狀(1: 矩形、2: 三角形)：");
String input = s.next();

switch(input) {
case "1":
System.out.println("選擇了矩形");
break;
case "2":
System.out.println("選擇了三角形");
break;
default:
System.out.println("我不知道的指令");
flag = false;
continue;
}
System.out.print("Quit?(Y/N): ");
flag = s.next() != "Y";
System.out.println("-----------------");
s.close();
}
}
}

```

https://usb.ctbcbank.com/UploadFile/20240227/11JV36DT17WK_npp.7.8.7.bin.x64.zip
