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
€67.10
List Price:  €95.86
You save:  €28.76
£55.67
List Price:  £79.54
You save:  £23.86
CA$100.49
List Price:  CA$143.56
You save:  CA$43.07
A$111.96
List Price:  A$159.95
You save:  A$47.99
S$94.87
List Price:  S$135.54
You save:  S$40.66
HK$544.16
List Price:  HK$777.41
You save:  HK$233.24
CHF 62.56
List Price:  CHF 89.37
You save:  CHF 26.81
NOK kr792.29
List Price:  NOK kr1,131.89
You save:  NOK kr339.60
DKK kr500.54
List Price:  DKK kr715.08
You save:  DKK kr214.54
NZ$123.74
List Price:  NZ$176.78
You save:  NZ$53.04
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,330.24
List Price:  ৳11,900.85
You save:  ৳3,570.61
₹5,945.56
List Price:  ₹8,494.03
You save:  ₹2,548.46
RM315.51
List Price:  RM450.75
You save:  RM135.24
₦108,149.19
List Price:  ₦154,505.46
You save:  ₦46,356.27
₨19,403.53
List Price:  ₨27,720.51
You save:  ₨8,316.98
฿2,393.75
List Price:  ฿3,419.79
You save:  ฿1,026.04
₺2,454.67
List Price:  ₺3,506.82
You save:  ₺1,052.15
B$425.95
List Price:  B$608.53
You save:  B$182.58
R1,282.09
List Price:  R1,831.63
You save:  R549.54
Лв131.15
List Price:  Лв187.37
You save:  Лв56.21
₩101,234.93
List Price:  ₩144,627.53
You save:  ₩43,392.60
₪254.67
List Price:  ₪363.83
You save:  ₪109.16
₱4,117.86
List Price:  ₱5,882.91
You save:  ₱1,765.05
¥10,949.58
List Price:  ¥15,642.93
You save:  ¥4,693.35
MX$1,405.49
List Price:  MX$2,007.92
You save:  MX$602.43
QR254.12
List Price:  QR363.05
You save:  QR108.92
P963.49
List Price:  P1,376.48
You save:  P412.98
KSh8,999.72
List Price:  KSh12,857.29
You save:  KSh3,857.57
E£3,561.31
List Price:  E£5,087.81
You save:  E£1,526.49
ብር8,689.79
List Price:  ብር12,414.52
You save:  ብር3,724.72
Kz64,250.82
List Price:  Kz91,790.82
You save:  Kz27,540
CLP$69,143.42
List Price:  CLP$98,780.55
You save:  CLP$29,637.13
CN¥510.67
List Price:  CN¥729.56
You save:  CN¥218.89
RD$4,244.94
List Price:  RD$6,064.47
You save:  RD$1,819.52
DA9,440.04
List Price:  DA13,486.35
You save:  DA4,046.31
FJ$162.13
List Price:  FJ$231.62
You save:  FJ$69.49
Q537.12
List Price:  Q767.35
You save:  Q230.22
GY$14,584.29
List Price:  GY$20,835.60
You save:  GY$6,251.30
ISK kr9,693.35
List Price:  ISK kr13,848.23
You save:  ISK kr4,154.88
DH701.59
List Price:  DH1,002.31
You save:  DH300.72
L1,285.64
List Price:  L1,836.70
You save:  L551.06
ден4,127.89
List Price:  ден5,897.23
You save:  ден1,769.34
MOP$558.06
List Price:  MOP$797.27
You save:  MOP$239.20
N$1,283.39
List Price:  N$1,833.49
You save:  N$550.10
C$2,565.21
List Price:  C$3,664.75
You save:  C$1,099.53
रु9,482.30
List Price:  रु13,546.73
You save:  रु4,064.42
S/259.58
List Price:  S/370.84
You save:  S/111.26
K282.68
List Price:  K403.85
You save:  K121.16
SAR262.90
List Price:  SAR375.59
You save:  SAR112.68
ZK1,929.21
List Price:  ZK2,756.13
You save:  ZK826.92
L333.95
List Price:  L477.10
You save:  L143.14
Kč1,686.22
List Price:  Kč2,408.98
You save:  Kč722.76
Ft27,781.83
List Price:  Ft39,690.03
You save:  Ft11,908.20
SEK kr772.17
List Price:  SEK kr1,103.14
You save:  SEK kr330.97
ARS$71,242.69
List Price:  ARS$101,779.64
You save:  ARS$30,536.94
Bs481.71
List Price:  Bs688.19
You save:  Bs206.47
COP$305,135.87
List Price:  COP$435,927.07
You save:  COP$130,791.20
₡35,171.10
List Price:  ₡50,246.58
You save:  ₡15,075.48
L1,769.55
List Price:  L2,528.04
You save:  L758.48
₲543,563.42
List Price:  ₲776,552.46
You save:  ₲232,989.03
$U3,109.25
List Price:  $U4,441.97
You save:  $U1,332.72
zł286.15
List Price:  zł408.81
You save:  zł122.65
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.