Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
Join author David Gassner as he explores Java SE (Standard Edition), the language used to build mobile apps for Android devices, enterprise server applications, and more. This course demonstrates how to install both Java and the Eclipse IDE and dives into the particulars of programming. The course also explains the fundamentals of Java, from creating simple variables, assigning values, and declaring methods to working with strings, arrays, and subclasses; reading and writing to text files; and implementing object oriented programming concepts.
The Java programming language has been developed over the years following some very strict principles. The five principles of Java as declared when Java was created include, first, that it's a simple, object- oriented, and familiar language. Its simplicity lies greatly in its consistency. Once you learn how to do one thing in Java, you know how to do it the same way throughout the language because it never deviates from the way the language is architected. It's an object-oriented language. So once you understand the principles of encapsulation, inheritance, and polymorphism and how those are implemented in the Java programming language, you'll have a much better sense of how to architect your applications.
And for developers who've worked with C-Style languages like C and C++, the syntax of Java is very familiar. Java was created to be robust and secure. Its robustness lies greatly in its object-oriented characteristics, because you're designing everything as an object, everything has methods or functions and properties also known as fields. And you create applications by combining multiple classes together. This lets you create your code in small chunks and it makes it easy to debug and maintain your applications over time.
Java was designed to be portable, so that you'd be able to compile it once and then run your application on multiple operating systems and processors. Java was created to be high-performance. The original version of the Java Virtual Machine wasn't as fast as C++ applications, but over the years it's been improved enormously, and today Java applications run just as fast or sometimes even faster than applications built in C++. And finally Java was created as an interpreted language, it supports multithreading and it's dynamic.
Interpreted, means that the application is compiled to a format that's interpreted at runtime rather than being run as machine code directly, this is what makes the applications portable. It's multithreaded, and it makes it easy to build applications that do more than one thing at the same time. And it's dynamic, in that it can change data types at runtime as long as those data types are compatible with each other. Here is the runtime architecture of Java. Again, it's an interpreted language, the application is compiled to bytecode rather than machine language, and that's what makes it portable between operating systems.
Here is the software stat that's used at runtime when you run your application. You start with the operating system. You can run Java applications on Windows, Mac, Linux, Solaris, and any other operating system for which there is a usable Java Virtual Machine. The Java Virtual Machine you use most of the time will be the one provided by Oracle, the one that was created by Sun Microsystems, but there are other JVMs out there provided by IBM, the Virtual Machine that's provided for Android by Google and many others.
On top of the Virtual Machine you add the core runtime and additional libraries. The core runtime is sometimes called the Java Class Library, and it consists of all of the functionality that's provided with the core Java developer toolkit. And finally your application runs on top of all that once again as compiled bytecode. So let's compare Java to a couple of popular languages. First C++, Java was originally created by C++ developers and they had in mind improving the developers' lot.
Here are some ways in which Java is different from C++. If you're a C developer all of your code can be run in C++ as well. The two languages are compatible with each other, that's not true for Java. Even though Java has syntax that's very similar to C and C++, its code is unique. It has its own rules and its own syntax. I have mentioned earlier that C++ is compiled to native machine language and while that makes it very fast and gives it access to low-level functions, it means that your application has to be recompiled for each operating system and processor that you want to target.
Java is compiled to bytecode. Because C++ is compiled to native machine language, it allows direct calls to the native system. In Java there is an interface called Java Native Interface sometimes called JNI, that lets you call those native functions through the JVM. C++ lets you write once and then as long as you followed standard C++ syntax you can recompile for each operating system you are targeting, whereas the principles of Java say that you can write once and run anywhere.
Java runs in a protected virtual machine environment, and again, you have to go through that JNI interface to make those low-level system function calls. Here's a way in which the two languages are very different. C++ requires explicit memory management and uses pointers. C++ applications as a result can have memory leaks and it's up to the developer to make sure that they've sealed up all the holes in their application. In Java, memory is managed for you. When you create instances of classes or objects, the Java Virtual Machine automatically allocates the memory.
And when you're done with the objects the JVM sweeps up the memory by destroying dereferenced objects, this is called the Garbage Collector. This means that in Java applications you don't have to know specifically how much memory is being used at any given time, you still have to pay attention to making sure that you only create the objects you need. And in C++ you can use multiple inheritance, this means that when you define an object you can inherit functionality for multiple super classes.
There are currently no FAQs about Java Essential Training.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.