Start learning now
You've reached Level 15!
The fourth level of the second quest is behind you. Congratulations on your latest achievement! You've learned a lot about type casting and the instanceof operator, and you've completed 24 tasks. On the fifth level, we'll deal with method overloading and understand the special features of constructor calls.
Access modifiers, method overriding, and implementing abstract methods
Let's dive deep into "access modifiers" and find out how they relate to the implementation of abstract methods and interfaces, as well as method overriding. Modifiers, like security guards, answer the question "Who can access this method/variable?" This lesson has the details.
Tasks | Level 5 | Lesson 2
Diego the Robot misses you! And when Diego's misses you, he starts coming up with tasks. This is a great time to evaluate Diego's work. We draw your attention to some tasks about OOP! You need to understand inheritance, arrange the interfaces correctly, and fix the bugs.
Overloading methods | part 2
Method overloading shouldn't lead to a brain overload. That's why teachers at the secret CodeGym center impart their knowledge in small doses. You've already heard that each method must be unique. It is unique when the class has no other method with the same name and parameter types (the order of the parameters matters). Dive deep into this topic!
Practice overloading methods | Level 5
It's not easy for an aspiring programmer to get used to the fact that a single method name can represent a truckload of different implementations. In fact, this is a huge advantage and should only give you cause to rejoice. In this lesson, which includes five tasks, you will practice creating, editing, and analyzing overloaded methods.
Creating objects: the order of constructor calls
When you create an object, what happens in memory? At what point are values assigned to variables when a constructor is called? It's very helpful to know things like this. And not only because you'll be asked in an interview: when you're familiar with the process, it's much easier for you to imagine what happens and how.
Tasks | Level 5 | Lesson 6
Meyer's law says: "It's simple to complicate things, but its difficult to simplify". However, overcoming these complexities makes code beautiful, causes trees to blossom, and creates butterflies in the belly... We don't promise the second and third outcome, but the first is guaranteed. Don't delay! It's time to tackle a code optimization task.
Loading classes, static data…
You already know that Java classes are files on disk that contain bytecode, i.e. compiled Java code. The Java machine doesn't load them if it doesn't need to. As soon as there's a call to a class somewhere in the code, the Java machine checks to see if it is loaded. This lesson will teach you what happens if isn't loaded... and much more.
Order of variable initialization
In previous lessons, we found out that a class is loaded from the top down. Accordingly, it's important that class members only access fields that have already been loaded. But what happens to variables? What order they are initialized in? Dr. Laga Bilaabo will tell you.
Tasks on the order of variable initialization
Sometimes you're given some code at a job interview and asked to describe variable initialization. It's an important topic and needs to be understood and mastered. Your teacher Diego understands this perfectly, so he's prepared five tasks for you on this important topic. Don't drag your feet!
Useful links from the Professor — 15
Of course, looking at the same material from different angles is useful, because everyone thinks differently, and perhaps for you the best source of the theory will be different from the source best suited to your friend. Especially for you, the Professor found a very interesting lesson that will teach you more about overriding methods and constructors.
Time for Stranger Strings
It’s almost the end of Level 5! Are you ready for the final tasks? Julio is sure you need to have a break and watch this thrilling but bizarre video. Grab your pizza (or whatever you need to enjoy a movie) and relax a little bit. Stranger Strings is coming up!