From Python to Java - Variables, If-else, while loops, comments, and basic type casting tutorial

preview_player
Показать описание
Introductory Java Lesson for Python Programmers. Bookmarked table of contents below. Implement an app in both Python and Java and translate fundamental concepts between languages. Second video in short course teaching Java basics for the Python programmer (playlist link below).

0:00 - Let's build a simple command-line app in Python and Java
0:27 - Basic application structure in Python
1:45 - Starting a new Java project in IntelliJ IDEA Community Edition
6:53 - Generating a random integer in Python
11:36 - Variable declarations in Python vs. Java
16:14 - Generating a random integer in Java vs Python
23:11 - if, then, else statements in Java vs Python
30:43 - Using command-line arguments in Java's main method with an IntelliJ Run Configuration
36:03 - Writing a while Loop in Java vs Python
39:10 - Single line comments, multi-line comments, doccomments vs docstrings in Java vs Python
42:41 - elif in Python vs. else if statements in Java
45:06 - Single line statements vs Block Statements in Java
50:33 - Comparing Python and Java side-by-side

Рекомендации по теме
Комментарии
Автор

We need more, or at least I would have needed for the rest of this semester

Ggwpleohar
Автор

Thank you for this excellent video. Shame that the announced further videos apparently have come to naught, but I know how it is....

EduardvanKleef
Автор

Excellent videos, I just subscribed. Thank you!

sgballet
Автор

Hey! I just found your channel and subscribed, love what you're doing! Particularly, I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your YouTube Journey, can't wait to see you succeed!
Your content really stands out and you've obviously put so much thought into your videos! I applaud you for that and really wish you the best for the future!

Cheers, happy holidays, and keep up the great work :)

empowercode
Автор

Great videos on this topic! More videos like this one are very welcome! Especially how to translate python functions and procedures into java!

fredericoamigo
Автор

Love the course! I thought that the transition would be much harder before watching the video. Looking forward to the next videos in the series. Thanks professor!

akramznini
Автор

With python you don't actually need to tell it the type of varible you are creating. It figures that out automatically based on weather the value is sourrounded in quotations or not. Like number = 1 would automatically be an int. And number = "1" would automatically be a string.

accountname
Автор

To be honest I pretty much use single-statement ifs whenever possible in Java (and other C-style languages) since it usually fine when in the right context and (imo) the code looks cleaner. Though, it would be a lot nicer if Java and other languages took the Ruby route and allowed for single line ifs (like `puts "x is more than 5" if x > 5`, which does what you think it does).

ericschneider
Автор

Man, that command line app thing and set args to 5 thing is really confusing, I have a hard time replicate with VS Code.

liubaoying
Автор

So, for programming languages like python and Java when we use types like int and string. Is the program accessing some manually created type class that was coded into the language? Or are those types inherent to the computer?

benh.