Java Video Tutorial

About

This 54 episode Java Tutorial David Gassner takes us through the essentials of the Java Programming Language. Starting with an explanation about the history of the Java Programming Language, the JRE, JDK, Language principles, things to be aware of and more.

Next to what I tell you here, the videos contain much more. Like the top time savers available in Eclipse (CTRL+ SPACE code completion which saved me hundreds of hours typing). If you are like me and want to work smarter, not harder, this video course is what you need!). So let’s start learning! The complete list of videos can be seen here. Although this site isn’t YouTube you can navigate from video to video by clicking the back-button of your browser and choose a different video each time you want to select another video to view.

I hope you enjoy the course. Please leave a comment if you want to see more of these courses!

Index

Welcome – A welcome word from David Gassner including an explanation of the training objectives. And what we can expect from the training. I already can tell you it’s worth the trouble! start learning Java: View part 1.

Principles – The vife principles of the Java programming language.

Syntax – First we are introduced to the JDK and it’s separate utilities. Later on we get a quick walk trough the ‘Hello World’ Application.

IDE’s for Java – How are Java Source files compiled plus an overview of the Integrated Development Environments available for Java on different platforms.

Variables – Just like other Programming Languages Java has Variables. There are two main categories; Objects and primitives. Different types can be converted. Additionally variables have a scope. View.

Numbers – In Java numbers can either be primitives or Objects. You should be aware of this since inappropriate use can lead to problems. View.

Casting numberical values. – You need to be careful with conversion of primitives because the Wrapper classes don’t have the same accuracy it’s possible that you may lose data this part of the tutorial gives you the details you need to be able to avoid problems. View.

Operators – if you already know JavaScript you have enough knowledge about the Java Opererators. If not. View.

Outstrings – How chars can be concatinated and printed to the console. View.

Calculations – Sit down and relax while watching how to create a simple Java calculator in Eclipse. View.

Conditions – These are operations which can only evacuate to two outcomes. True or False. This tutorial builds further on the previous tutorial of (24). View.

The switch -The switch is the most elegant way to evaluate multiple .possibilities without having to write multiple if / then clauses. View.

Looping – This is just another way of flow-control in Java Applications. View.

Methods – Are like functions in other programming languages. Will a few differences (like the access modifiers) learn all about it here.

Method arguments – like in functions you can pass arguments when calling it. In Java you onLy need to add the data types. View.

Overloadingmethods. In fact there are two different and simular things which always confuse the Java students; Overloading and overriding methods. In this part of the course we will learn about overloading. Overriding will be shown later on. Watch.

The difference between a copy and a reference – This is an essential concept to understand. It also introduces the concept of Immutability. Watch.

Advancing the Java Calculator – In this part we will add substraction, multiplication and devision. Just like in the real world we’ll encounter some issues. View.

Strings – In Java a String (with capital S is not just a variable. Strings are Objects and have some weird properties and their own methods . View.

The immutability of Strings – Especially for those who are planning to get certified in the Java programming Language this is a very important concept which you need to understand thoroughly as it’s one of the exam objectives! View.

More methods of the String Object – This lesson covers finding the position of substrings, extracting substrings, and parsing Strings. View.

Encapsulation – This is one of the four principles of Object Otientation. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, it is also known as data hiding. View the course.

In this case we will see how encapsulation is done by refactoring the existing code of the calculator class. View.

Organizing the code into packages – This is common good practice in Java Development. See the lesson.

Instance methods – In all the episodes before we saw only static methods. Static methods belong to the class, whereas insance methods belong to the instance. The difference is that the instance is actually instantiated with the new keyword. These classes have become live Objects andexist in memory. View.

Constructors – These are methods which automatically executive when a new instance is created. Eclipse can generate the constructor automatically for you. See the tutorial.

Accessor methods – Also known as getters and setters are instance methods. They can set the value of a field or retrieve it. Watch the tutorial.

Class Variables vs Instance variables – We already discussed this with methods in lesson 39 variables are very similar. One special variable is the constant. It’s usually declared as public static final and by convention consists of capitals only, View.

Inheritance – This is the second OO principle. It brings hyrarchie between classes. Jargon: We say that a base class can be subclassed (or using the extends keyword, a subclass can inherit from it’s superclass ) . When you create your own class and let it extend another class, your class will inherit all methods and properties from the class it’s been extended from. This means you can use all it’s methods. This is often done. For example if you want to create a class which behaves as a HashMap you can do it as follows;

Note: it’s important to distinguish between ‘is a‘ and ‘Has a‘. In inheritance we say ‘is a‘ . The subclass ‘is a‘ SuperClass because it’s an instance of it’s SuperClass. On the other hand, each class ‘has‘ many instance variables, these are ‘has a‘ relationships.

The result will be a class which has the same methods as the HashMap. To call the methods from the superclass, use the keyword

super

Similarly the Constructor of the superclass can be called from the subclass Constructor:

Please note that the Tutorial says that Java doesn’t support multiple inheritance. This is NOT true. Java Supports multiple inheritance trough Interfaces.

Overriding – This is similar to overloading (see above in point 30) Don’t confuse both principles. Subclasses can override the methods of their superclass. This allows you as the programmer to change the behavior of the subclass. Watch. Please note an important difference between overloading and overriding. In overloading only the method signature can change. Overriding (as the word implies) can change the whole method. Also note that you can add an @annotation

@override

. Although it’s not necessary, it improves readability of your code.

Interfaces – I already mentioned it before. Interfaces offer more flexibility to Java because a class can implement multiple interfaces. Since Java does not have multiple inheritance, using abstract classes prevents your users from using any other class hierarchy. In general, prefer interfaces when there are no default implementations or state. Watch.

Creating interfaces – Compared to normal classes, Interfaces are weird animals. They don’t have a class body but instead only contain method signatures. Interfaces also can not have a constructor since they are not meant to be initiated. Watch.

Working with files – As a Java programmer you will find yourself working with files often! Weather it’s reading or writing. By reading a file and writing it you are actually copying the file. See this in action.