Consider the following programming languages: C, C++, Java, Ruby, Python.
a. (3%) Which languages do not require a compiling stage before execution? b. (3%) Which languages support object-oriented programming? c. (3%) Which languages are supported with compiler (or interpreter) on both Windows and Linux operating systems?
a. Ruby、Python:由 interpreter 直接讀 source code 執行。C、C++ 要先 compile 成機器碼;Java 要先用 javac compile 成 bytecode 才交給 JVM,所以也有 compile 階段
b. C++、Java、Ruby、Python(有 class、inheritance、polymorphism);C 是 procedural language,不算
c. 五個都有:C/C++ 有 GCC、Clang;Java 有兩個平台的 JDK;Ruby、Python 都有 Windows 與 Linux 版 interpreter
a. Ruby、Python b. C++、Java、Ruby、Python c. 全部五個