JAVA TUTORIAL FOR BEGINNERS (2020)


Ladies and gentlemen this is my complete
Java tutorial series for beginners you can call me bro and before you sign up
for that expensive online course or coding bootcamp I highly recommend you
check out this video tutorial series of mine because I will probably teach you
everything you need to know and more for absolutely free the only cost is your
time so honestly what is there to lose I genuinely want to help others because I
really struggled with this material when I was in college I felt so confused and
helpless at the time and I don’t want other people to feel like that so I
would love your support for this channel if you would like to learn Java look no
further because you’re in the right place let’s get started I’m gonna give
you a quick rundown of how the java programming language works if you
already know the stuff feel free to look in the description for any timestamps
and you can skip forward so programming languages tend to be on a spectrum
between being high level and low level a high level language means that humans
can more easily understand it it might contain words such as like print you can
easily understand that the word print probably means to like display something
or print out something and the low-level languages they are more easily
understood by computers because they’re in a format that’s easier for them to
process for example object code it’s all binary zeros and ones that’s the type of
language format that computers can easily compute however humans have a
difficulty with actually processing this zeros and ones so we like to write our
programs and source code and then what we do is that we compile it into object
code zeros and ones so that a computer can read it our Java source code is
identifiable because it ends with the Java file extension and object code
typically ends with the dot object file extension now one problem we have is
that if we write programs and let’s say on a Mac computer when we compile it to
object code directly we can only run that on a Mac computer because it’s
machine specific and same thing with Windows and you know so on and so forth
so what we need to do a way around this is that we can compile it to this
intermediary step called bike code and that’s somewhere
between a high level language and a low level language and you can identify bike
code because it ends with the dot class file extension now we can use this bike
code for Windows Mac Linux because it’s portable and then we can use a Java
Virtual Machine to translate it further into object code so these are the basic
steps we’re going to be writing our programs in source code we compile it to
bytecode and this bytecode is portable to different machines and then we can
use a java virtual machine to translate it to object code that a computer can
understand got it makes sense all right let’s move on to begin we’re gonna need
two things we’ll need an IDE that stands for
integrated development environment and that’s basically a software that helps
us write software the other thing we need it’s called a JDK it’s an acronym
for Java development kit it contains a lot of the tools we need to actually
program such as the java virtual machine and a few other tools for our toolkit
all right so let’s begin by downloading the JDK to begin open up your web
browser of choice then we’re going to look up Java JDK download and it’s gonna
be this first link Java SEO downloads well I guess it’s the first link at the
time of this video it could change but look for this Java SC downloads and I’m
just going to download the most recent one
it looks like it’s Java SCA 13 find the appropriate one for your machine I’m
using Windows so I’m going to download this dot zip file but use whatever you
want oh and make sure you accept the license agreement otherwise it yells at
you all right now let’s download this and now we wait
alright this file is done downloading so I’m going to show it in folder and we’re
going to unzip it looks like I downloaded to extract all this is if
you’re using Windows Mac and Linux users might have something else but I’ll give
you the approximate steps to get this up and running now it’s just a matter of
waiting if there’s any prompts it’s just a matter of accepting them
all right so then let’s begin downloading Eclipse or whatever other
IDE you want to use I already did most of my tutorial in
Eclipse and I’m actually refilling this first episode here so I’m just going to
continue using Eclipse but I’ll provide some links in the description for maybe
IntelliJ IDEA and that means if you prefer to use those so we’re going to go
to if you’re using Eclipse or want to use the Eclipse IDE eclipse.org slash
downloads alright so then if you’re using windows you can just hit the
download 64-bit button if you’re using Linux or Mac you might have to go to
download packages look for where is it Eclipse IDE for Java developers and then
download it here and follow the steps since I’m using Windows I’m just gonna
go with the quick install so just hit the orange button and then download all
right then it’s just a matter of waiting for the download and it’s finished let’s
open it so once you open that file the download process should start so then I
recommend going to Eclipse IDE for Java developers and then install read the
License Agreement yes I actually did read it that fast and except now except everything all right if this
certificates window pops up just click the check box you might need to click
that to always accept certificates accept selected and then just wait and
launch then click Launch or you can change the
workspace if you want I’m just gonna use the default now after launching eclipse
you’ll probably be brought to this welcome screen you can just close out of
this now if you want to create a new project go to file new Java project and
I’ll name this hello YouTube but make sure you misspelled it YouTube alright
and then click finish then create now we’ll need to create a class alright
then we’ll need to create a class click on your project folder then go to the
top toolbar and go to file new class and I usually like to name this first class
main with a capital M and then click this check box that says public static
void main and I’ll explain what that does in just a moment alright so this is
our class to start with our main class I’m going to adjust a few things here
like moving this task list and then if you want to zoom in you just hold ctrl
if you’re using windows ctrl + and you could zoom in so then you can see things
more easily now there’s this class main and then within it there’s this thing
called a main method and we actually need this method in order to run the
program and these words might not make sense right now but in time we’ll slowly
decipher what each of these words mean so we actually need this bit of code to
actually run the program and this is actually a comment you can just take
that out that auto generates when you click that checkbox so we do need all of
this this block of code in order to run the program and we’ll actually get an
error if we take this out so I’ll try and run this yep in this red text right here is an
error and this is our console window this will display a text or whatever
else is going on we can have our program like run in here and display stuff so if
you’re missing that main method you can easily just type it in and that was the
whole point of that checkbox when we created this class so you just type in
public static void main and make sure it’s lowercase M
parenthesis and then within the parenthesis type in string with a
capital S and then a pair of straight braces space arg s and then in curly
braces so we don’t know what all these words mean quite yet but in time we will
so I read a textbook for one of my computer science courses for Java and
they said that fernell think of this as like some sort of magical spell or
incantation that we have to say in order to get our program to run so now if we
run this program by hitting this green run main button that error disappears
although nothing appears in the console window because we haven’t done anything
yet we didn’t type any code yet so if everything’s working as it should you
should see like no error when you run this now if we want to print something
to the console window there is a line of code that we need to type and that’s
system that out dot print so system dot out dot print and then you need a pair
of parenthesis and a semicolon at the end and whatever you want to display to
the console window you just need to put this within parenthesis so you could say
something like hello yeah let’s spell like that make sure you misspelled hello
and then okay and you can see that whatever we typed within the parentheses
not the parenthesis the quotation marks appeared in the console window so you
could type something like never gonna give you up honestly you could just type
whatever you want within reason there’s a few key words that Java doesn’t like
all right so make sure you have those quotation marks like if I take them out
it’s not gonna work we should get some sort of error
yep just like so and this is sometimes referred to as a string literal a string
is a series of characters now if we want to go to the next line there’s a
character we can type in it’s I believe it’s backslash N and then we’ll go to
the next line so I’ll just type in like another set of lyrics here never gonna
let you down feel free to type whatever you want yeah and the next line moved
down by one so if we got rid of this backslash and that’s an escape character
for a new line see if we just just do this this would all be combined into one
now odd instead of typing in that backslash n you can change the print to
print Ln and this works as if we’re hitting enter at the end of our string
literal here so you’ll commonly see people either have like print or println
for print line now there’s a few other escape characters besides like backslash
n which is for newline like here we got have a new line and then the rest of our
lines came right after that if you do backslash T that’s an escape character
for a tab and this should push our text over slightly if you need to display a
double quote you type the backslash double quote it’s like we’re quoting
something so backslash quote double quote and then run this and our first
line is in quotes because if you just have two set of quotes Strava doesn’t
know exactly what you’re trying to print out so if you want to like explicitly
print out quotes you just put backslash then the quote double quote alright and
the next one is that if you have to print a backslash you just do two
backslashes just like that now if you ever close out of this console window
you can use we bring that back just by going to
window show view console and this will just bring it back now for a cool trick
that I’d like to show you guys is that we can actually change the color scheme
for our IDE and if you prefer to use this black text on white background you
can but I like to change mine up a little bit so go do if you want to
change it go to window preferences then go to general appearance so currently
our theme is light I think I’m gonna go to dark because it’s cool apply and then
applying close and then click OK now if you prefer you can change the color
scheme of the console window separately and if you prefer to do that go to
window preferences then scroll down to run debug near the bottom here console
and then here you can change the color scheme I think with the background color
I’ll choose a slightly darker shade of black and then for the text color I’m
going to go with like a bright green so it reminds me of those old monochrome
monitors it also reminds me of the computer consoles from the Bethesda
Fallout series so that’s another good reason so that is basically everything
you need to get up and running in Java ladies and gentlemen that will conclude
this episode of bro code you did great by making it to the end keep up the good
work if this video helped you out you can help me out by smashing that like
button and leave a comment behind subscribe if you’d like to become a
fellow bro

One thought on “JAVA TUTORIAL FOR BEGINNERS (2020)

Leave a Reply

Your email address will not be published. Required fields are marked *