Java
Hey guys, he's my kids and on with a video on Java. So, as you may know, this summer I'm doing a programming lesson course, basically along with my regular videos. Next comes six to eight Java lessons.
I find that people don't actually appreciate Java as much as they should, and people don't even know what Java really is. So, I'm going to explain to you what Java is.
First of all, Java is made by a company called Sun. So, if you look at my screen, you can just go to sun.com, and this is their official site. They have a lot of other things like VirtualBox. They also made Solaris; they made Java, their most, pretty much the most prized thing. They remember me, and I think Java has great appeal.
Here’s what Java does and here’s why it’s so fancy: Java was made by Sun and Sun was planning on having it be the programming language. The programming language is not just a programming language; they were hoping that it would be the thing that Mac programmers use, the thing that PC programmers use, the thing that Linux programmers use, the thing that cell phone programmers use. Now, that never really happened.
I mean, you can still get Java on Linux, you can still get it on Windows, it comes with Mac automatically, and that’s great. But ultimately, it's just not universal like it should be. My dad has a cell phone that runs Java, but other than that, I haven't seen any cell phones that run Java.
Anyway, Java is more secure than practically any other programming language because it runs your app in a virtual machine, meaning that your application cannot have power over the machine that it shouldn't have. See, if you have a character array that’s 512 bytes and you try to write to the 513th byte, you’re writing to some of the program's memory or another place in yours.
But with Java, the only memory that you can see, you think you own the machine. The Java program itself thinks that it owns the computer it’s on, that there are no other programs on it, which makes it so cool. So, that’s why Java is secure; it can’t overwrite the stack, it can’t mess with other applications. It's almost like 64-bit; it’s more secure.
Another thing about Java: it looks a lot like C, and if you use C#, you’ll appreciate Java a little bit more. Java is almost perfect. It's like the .NET languages, except that it works on everything.
The cool thing about Java is that GUIs are so easy, and if you make a GUI app in Java, you can run it on a Linux box. It’ll look the same as it does on a PC, and it’ll look similar on a Mac, which is why Java is great. Java comes with every Mac, so if you’re using a Mac, it’s wonderful. You should have the latest version of Java; if you don’t, I’ll make another video on how to install it, just in case.
You can install it on Linux, I think just by typing sudo apt-get install java
. On PC, I think you can download it from sun.com. I’ll try to get a link for that in the description of the video.
An interesting thing about Java is that it doesn't create executables that are like .exe. It doesn’t create apps; it doesn’t just create plain old UNIX executables. It creates files that are called .jar, and running them on the Mac is easy; you just double-click. But if you want to run them on a PC or Linux, you just type java -jar [file]
, spacing and dragging the jar file.
So, if I just hit java
, it tells me that I have Java installed. java -version
I think will give you the version. So the latest version right now is 1.6.0_13. That’s what you should have; just take java -version
. If not, I will make a video on getting it, like I said.
So, anyway, this is my video on Java, explaining to you what it does, how it's secure, how it was supposed to work on everything, and it’s really a great programming language. It looks a lot like C, and you’ll learn quickly if you’ve already watched our C lessons.
So just hang tight; we’ll do Java soon and then we’ll get to Objective-C. Thanks for watching, my kids and all, and subscribe. Goodbye!