Back Java Tutorial for Absolute Beginners: Learn Java in 3 hours

120+
Created By: Rock the JVM
Published At: 2020-06-24
Search Query: Java Tutorial
Tags:
Java tutorial for beginners - Become a Java programmer. If you don't have any background into programming (or Java), this video is made for you.

Download this here: https://rockthejvm.com/p/java-tutorial-for-beginners

This video might look a bit weird and vertical, don't worry! I made this so you can follow along more easily: just take the video on half of your screen, and use your code editor on the other half, so you don't need too go back and forth between your code and the video.

- On Windows and some Linux OSes: drag this window until the mouse hits the left or right edge of the screen. It should resize to half the screen.
- On Mac: Make the video and your code editor fullscreen and then in the multi-desktop view, just drag one onto the other (see around 3.00).

In this Java tutorial, you will install Java 14 and your first development environment and you will learn to write your first Java applications. You will:
- understand how Java works on many platforms and why it's so popular
- create variables in Java, of various types
- compute any expressions you want, on different types
- make the computer do different things based on conditions
- make the computer automatically repeat instructions
- define your own data types with classes
- customize your data types with fields and methods
- understand the difference between access modifiers public and private
- write class-level fields and methods with the static modifier
- understand how a Java application runs

By the end of this Java tutorial, you will create your first chatbot - we'll call it Rock - which will greet you politely by your name, and will compute your age based on the information you give it. After that, it will perform a repetitive task very, very fast.

Table of contents:
0:00 intro
4:07 install Java and IntelliJ IDEA
7:28 create your first Java project
12:47 your first running Java application
15:20 variables
19:17 primitive types
28:29 incrementing and math operations
38:40 special characters
41:40 boolean operations
55:33 if-else statements
1:03:07 loops
1:16:29 defining a Java class with fields
1:34:07 defining and calling methods
1:56:12 arrays and foreach loops
2:09:51 static fields and methods
2:14:21 access modifiers
2:21:43 writing Rock, the chatbot
2:44:32 packaging the application
2:49:15 you rock

Follow Rock the JVM on:

LinkedIn: https://linkedin.com/company/rockthejvm
Twitter: https://twitter.com/rockthejvm
Blog: https://rockthejvm.com/blog

-------------------------------------------------------------------------
Home: https://rockthejvm.com
-------------------------------------------------------------------------
logo Ask VidTutorAssistant
Comment
or
Question
Your name
Comments with generated responses
@yendxc4802
2020-06-26

Around 38:18, the end result of someInteger should be 6?
Int someInteger = 4;
Int someInteger2 = someInteger++; // someInteger2 = 4, someInteger = 5
Int someInteger3 = ++someInteger; // someInteger3 = 6, someInteger = 6

I never like pre-incrementing or post-incrementing feature of Java syntax , very confusing and error-prone..
Also I can see why functional programming like Scala is catching on.

@rockthejvm

That's correct. The next pre-increment makes someInteger become 6 (sorry about the confusion). Also true on why FP in Scala is such a big deal :D

VidTutorAssistant (GPT-4)

Hey @yendxc4802, your interpretation of the code is correct!

When you have `int someInteger = 4;`, `int someInteger2 = someInteger++;` the value of `someInteger` has indeed increased to 5 after that line because it's a post-increment operation.

Then when you perform an operation `int someInteger3 = ++someInteger;`, `someInteger` is incremented before `someInteger3` takes its value. This means that both `someInteger` and `someInteger3` become 6, just as you said.

I understand that pre-incrementing and post-incrementing can be a bit tricky to grasp initially and they can be sources of confusion indeed. However, as we gain practice, our understanding will improve.

Regarding your comment on functional programming like Scala, I couldn't agree more. The immutable nature of data in functional programming makes the behavior of programs more predictable and easier to understand, which is possibly why many are gravitating towards it.

Don't hesitate to reach out with any further queries, happy programming!