What is Java?

13 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€65.44
List Price:  €93.49
You save:  €28.05
£56.04
List Price:  £80.06
You save:  £24.02
CA$95.74
List Price:  CA$136.79
You save:  CA$41.04
A$107.11
List Price:  A$153.03
You save:  A$45.91
S$95.36
List Price:  S$136.24
You save:  S$40.87
HK$547.90
List Price:  HK$782.75
You save:  HK$234.85
CHF 64.03
List Price:  CHF 91.47
You save:  CHF 27.44
NOK kr772.60
List Price:  NOK kr1,103.76
You save:  NOK kr331.16
DKK kr487.88
List Price:  DKK kr697.01
You save:  DKK kr209.12
NZ$117.84
List Price:  NZ$168.36
You save:  NZ$50.51
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,700.43
List Price:  ৳11,001.09
You save:  ৳3,300.65
₹5,837.33
List Price:  ₹8,339.41
You save:  ₹2,502.07
RM333.81
List Price:  RM476.90
You save:  RM143.08
₦92,489.99
List Price:  ₦132,134.22
You save:  ₦39,644.23
₨19,474.37
List Price:  ₨27,821.72
You save:  ₨8,347.35
฿2,588.61
List Price:  ฿3,698.17
You save:  ฿1,109.56
₺2,275.23
List Price:  ₺3,250.47
You save:  ₺975.23
B$358.08
List Price:  B$511.57
You save:  B$153.48
R1,312.98
List Price:  R1,875.77
You save:  R562.78
Лв127.91
List Price:  Лв182.73
You save:  Лв54.82
₩96,452.39
List Price:  ₩137,795.03
You save:  ₩41,342.64
₪267.73
List Price:  ₪382.49
You save:  ₪114.75
₱4,034.64
List Price:  ₱5,764.02
You save:  ₱1,729.38
¥11,065.06
List Price:  ¥15,807.91
You save:  ¥4,742.85
MX$1,201.03
List Price:  MX$1,715.83
You save:  MX$514.80
QR255.05
List Price:  QR364.38
You save:  QR109.32
P965.79
List Price:  P1,379.76
You save:  P413.97
KSh9,296.24
List Price:  KSh13,280.92
You save:  KSh3,984.67
E£3,349.82
List Price:  E£4,785.67
You save:  E£1,435.84
ብር3,985.10
List Price:  ብር5,693.24
You save:  ብር1,708.14
Kz58,375.85
List Price:  Kz83,397.65
You save:  Kz25,021.80
CLP$66,375.71
List Price:  CLP$94,826.51
You save:  CLP$28,450.80
CN¥507.11
List Price:  CN¥724.48
You save:  CN¥217.36
RD$4,113.13
List Price:  RD$5,876.15
You save:  RD$1,763.02
DA9,392.53
List Price:  DA13,418.47
You save:  DA4,025.94
FJ$158.35
List Price:  FJ$226.22
You save:  FJ$67.87
Q544.06
List Price:  Q777.27
You save:  Q233.20
GY$14,678.83
List Price:  GY$20,970.66
You save:  GY$6,291.82
ISK kr9,837.79
List Price:  ISK kr14,054.59
You save:  ISK kr4,216.80
DH708.72
List Price:  DH1,012.51
You save:  DH303.78
L1,246.75
List Price:  L1,781.16
You save:  L534.40
ден4,025.16
List Price:  ден5,750.48
You save:  ден1,725.31
MOP$565.76
List Price:  MOP$808.27
You save:  MOP$242.50
N$1,340.22
List Price:  N$1,914.68
You save:  N$574.46
C$2,582.07
List Price:  C$3,688.83
You save:  C$1,106.76
रु9,353.99
List Price:  रु13,363.42
You save:  रु4,009.42
S/263.57
List Price:  S/376.55
You save:  S/112.97
K270.82
List Price:  K386.91
You save:  K116.08
SAR262.50
List Price:  SAR375.01
You save:  SAR112.51
ZK1,859.31
List Price:  ZK2,656.27
You save:  ZK796.96
L325.94
List Price:  L465.65
You save:  L139.71
Kč1,644.39
List Price:  Kč2,349.23
You save:  Kč704.84
Ft25,720.62
List Price:  Ft36,745.32
You save:  Ft11,024.70
SEK kr762.14
List Price:  SEK kr1,088.81
You save:  SEK kr326.67
ARS$61,174.36
List Price:  ARS$87,395.69
You save:  ARS$26,221.33
Bs486.59
List Price:  Bs695.16
You save:  Bs208.56
COP$277,528.94
List Price:  COP$396,486.91
You save:  COP$118,957.97
₡35,172.98
List Price:  ₡50,249.28
You save:  ₡15,076.29
L1,732.56
List Price:  L2,475.19
You save:  L742.63
₲520,857.74
List Price:  ₲744,114.38
You save:  ₲223,256.64
$U2,703.34
List Price:  $U3,862.08
You save:  $U1,158.74
zł282.38
List Price:  zł403.41
You save:  zł121.03
Already have an account? Log In

Transcript

Hello there, and welcome back to this Java development course. So today we're going to be going over some of the very basics of what Java is and how it works. And sort of just getting an idea of how programming perhaps works in general. Okay, so generally speaking, you may have heard that the way computers work is that they just, you know, they have zeros and ones, maybe you've seen some movies where they're a bunch of zeros and ones flashing on the screen. Well, I mean, that's technically true. So computers do work in binary, which is just the idea of two different values being sort of existing.

It is a number system binary is actually a number system. So just like our number system, we have up to 10 in binary we have zero and one. So that's just a different number system. And in our case, since we are programmers, we can have different combinations of zeros and ones which telecom computer different things to do. So, for example, if I was to be programming a very simple computer, maybe in the 70s, or 80s, I could perhaps be writing something like this, I could do you know, maybe 011. I don't know exactly what type of computer I'm running, or if what language exactly I'm using, so like what processor the computer is.

So I mean, this isn't really correct. I don't even know if this exists, but let's just keep it as an example. So this command here could be two, let's just say take a number one, and then move that number into some place. So we can do this. And then this would be something else. And then this would be something else as well.

There we go. And so this code here would, I don't know, let's just say, take a number, move it into memory and then print the number. For example. And then printed, and then perhaps maybe maybe something else is too that would be to print the number. And then this was actually a number to print, just for example. And so that's essentially how very basic low level computer commands work.

So later on, somebody came along and thought this is difficult to program. So I mean, you can see how perhaps if you're doing if you know the language, and if you're doing maybe some very simple stuff, like adding two numbers together, or perhaps making making some a very simple program, it's okay. But if you're going to be making a website or a accounting, or accounting software, or maybe programming visuals, it presents a problem because it's after a while, it's going to be so much zeros and ones, you know, it's going to be very difficult to read everything you know, so if you have a couple thousand lines of the zero and one code, it's going to be difficult to work with. So then eventually, somebody came along and thought, Well, why do we need to have it all in numbers, when we could just write a program That would take some words and then translate them into numbers.

So that's exactly what they did. So then we got programming languages. So this is a programming language. For example, assembler was one of the one of the one of the first ones, we have, instead of doing this as a command, it just goes ahead and do move. And then you know, maybe some number one, two, let's just say 5656 will be somewhere in memory. So this is just a very, very basic example.

It doesn't actually work like this. But just to give you an idea of exactly what happened. So then we move the number one into 56. So ramps LOD 56, let's just call it like that for now. And so what then the program would do is take this, it would read it, and then translate this into the numbers. So 0110 something, there'll be a move, and then some number, so it's going to be one.

So one is just like this, I think There we go. Yeah, that's one. And then two would be some other command. And then, and then some ramps LOD 56 don't exactly know what 56 is, like, let's say let's say this number, I don't think that's 36, actually, but yes, that's actually how you do it. So that's, so it goes in and takes this code that we wrote, that's easy to read, and then translates into this code that is difficult to read. But for computers, it's the only thing they can read.

So they can't actually read this, we have to then translate this into this also using another program. And so that's essentially how very basic programming languages work. Of course, this still presents problems. So again, it is easier to read but if you are programming applications that are very large and bravely that utilize graphical user interface programming, I mean, how will you program graphical user interface of graphics with this, so I mean, you're going to be doing a lot of things. And so in results, we got more high level languages. So instead of having move one 256, or something like that we have something else.

So we can now do int, a, got to type a equals one, there we go. So now instead of doing move one 256, and then calling the number 56, we can now just create variables. So this is a completely different way of thinking about programming itself, then it reads this int a equals one. And then it translates this into the other code that we went over, that's easier to read. So it's going to be move one, two, and then some part in RAM. And we don't actually need to specify words that we're going to move it so it'll automatically move it to some part.

And it's going to assign this name that we have with the variable to the part where we actually move it. At this point, it may get confusing, don't worry, this is very non trivial stuff. And usually when People actually learn programming, they don't really learn this and they don't understand it. But it is very, very important to understand if you are going to be working with programming. So this is just the idea of variables and where they came up. So in this case, if we create a variable called a, and we will go over variables more in the next lesson, I believe.

So if you don't understand something, don't worry about it. Even if you don't fully get something now later on, it will naturally come to you and you'll naturally start to understand it. Of course, this will vary greatly help with that, and you'll get a better idea about what variables are. So anyway, moving back. So in this case, we create a variable named a, right with the value of an int. So an int is just a number so integer, and then assign it the value one, and our program automatically thinks Okay, so we need to take the RAM and then we need to move the number one into somewhere.

So in this case, it moves it to 16. And then It also goes ahead and says it, that a in this case will be the value in 16. So then this is translated into that. And then this right here is finally translated into the machine code. This is just the machine code that is actually run, just like something like that. Something like that.

So it isn't necessarily real, it doesn't actually work like this, but just it gives you a very good idea of what exactly is happening. And so this is essentially where Java itself is. So in this case, Java is on this level here. So we create this code. So we can create variables, assign a value, and then Java, the Java compiler, or actually, in this case, it'll be the virtual machine will translate it into this right here. And then this will be translated into this by the Java compiler.

Okay, so this is a coding example. Now. Let's Take a look at a very simple diagram that will give you a better idea about how it works at a higher level. Okay, so right here I have a very handy diagram that essentially tells us how Java works. So first of all, everything starts with the source code. So this is what we write.

So do you remember in the last lesson when we wrote System dot out dot print ln hello world, that is called source code source code is very easy to read. And it's actually what we write when we write Java code. That's called source code. So that source code is then translated into bytecode using the Java compiler. So the Java compiler is just a program that reads our source code and translates it into bytecode. So bytecode is actually that thing that we went over, you know, move one to 16.

That's called bytecode. And so that's essentially what the bytecode does. So that bytecode is actually what's called a jar file. So if you've ever downloaded it I will file from the internet, you may have heard of JAR files. So when you actually do download a jar file, you download bytecode. And that bytecode is then going to be run on different operating systems.

So this is another feature of Java that we need to go over. So Java is platform independent, which means that let's say that we write system out print hello, and hello world, we can now run that on any operating system. So that same code can be run on Windows, on Linux, and on Mac. So we don't have to rewrite our code for different operating systems, which shortens development time and cost significantly. How does this work? Well, let's just say that I write a Hello World program.

Okay, that Hello World program and it's translated into a Java specific bytecode. That bytecode is then distributed. So let's say I'm on a Windows computer, I download that Java bytecode and then that Java bytecode runs on the Java virtual machine that is installed on my computer. And then that Java Virtual Machine translated into operating specific operating system specific machine code, which then runs. So essentially, this is just a means of removing the factor of rewriting code for different operating systems, which actually is a little bit of a nuisance because let's say that you've created an application, it's a great application, and you've blown your budget on it. So you had a budget of $100,000.

So you've hired programmers, you created the application. But now you have to translate it into Mac into Linux, maybe some versions are incompatible with different types of windows and so on, and so on. And as a result, you get the problem of having to rewrite your application a couple times, which greatly increases development cost. So as a result, you can actually just write it in Java and in result as long as the user that is using your program has Java Then you won't have to rewrite the program and it will work on their computer. So that's essentially how Java works. So we write source code, it is translated into bytecode by the Java compiler, which is just a program.

And then that bytecode is distributed, and it runs on a computer, which then translates it into machine code. Operating System specific machine code. So machine code on Windows machine code can't run on Mac, or Linux. So that's just just just so you can get an idea and then that machine code is then actually fed into the processor and is actually run. So that is essentially an overview of Java and how Java works. Now, at this point, there are most likely a lot of things that you're not understanding.

So one of the world is Ram perhaps if you're really new to this, you don't know what RAM is, perhaps you don't even know what a processor is. Don't worry. So for now, this is just a very basic overview video as you start to Get more and more into computers and how they work and how programming works. You're going to start to understand all this in this video, you're going to think back to it and think, Oh, well, that makes sense. Maybe it already makes sense to you now. But nevertheless, if it doesn't, don't worry about it.

This is the second lesson of programming that you're doing. And this is pretty, pretty low level stuff. This is the kind of stuff that programmers don't really learn first, but it is good nevertheless, to learn it first. So then later on, you're not going to have any confusion when you're actually going to be writing your program. Okay, so this is just the last lesson on how Java works. Next time, we're actually going to get into writing variables actually doing some stuff.

We're actually gonna have some homework next time. And we're actually going to write our very first, we've actually written our very first application, so system out println hello world, that's technically an application. But we're actually going to be creating a legitimate, useful application that we can actually use for something It's gonna be like a very basic, very basic calculator essentially. Okay, so then, without further ado then I'll see you next time.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.