Table comparing syntax and features commonly used in Java, Python, and JavaScript.

Table comparing syntax and features commonly used in Java, Python, and JavaScript.

Java Python JavaScript
public class class class
class class class
public static void main(String[] args) def main(): function main()
System.out.println() print() console.log()
int int number
double float number
boolean bool boolean
char str string
String str string
true/false True/False true/false
null None null
void - undefined
import import import
subclass name extends Parent Class Name subclass name(Parent Class Name) subclass name extends Parent Class Name
implements - -
try { } catch (Exception e) { } try: except Exception: try { } catch (e) { }
switch (x) { case 0: break; } if x == 0: switch (x) { case 0: break; }
for (int i = 0; i < 10; i++) { } for i in range(10): for (let i = 0; i < 10; i++) { }
while (true) { } while True: while (true) { }
do { } while (true); - do { } while (true);
break break break
continue continue continue
return return return

シェアする

  • このエントリーをはてなブックマークに追加

フォローする