Member-only story
From Python To Java (Part 1)— The Basics
4 min readDec 11, 2021
This series of articles is written for those of you who are somewhat comfortable in Python, and are looking to pick up some Java. In this article, we’ll do a couple of basic tasks in Python, and then the equivalent in Java
1) Printing Hello World
hello.py
print("hello world")
Note that we can call our file whatever we want eg. helloworld.py
, hi.py
, aaaaa.py
and it wouldn’t matter.
Hello.java
Note that:
- The file name
Hello.java
must be the same as our class nameHello
- There must be a
main
function print
in Python →System.out.println
in Java- The other weird stuff that you see will explained later
2) Running Our Code (using CMD/Terminal)
Running hello.py
python hello.py