How Object Initialization Works [Videos]

From DZone Java Zone
March 19, 2017 - 1:01am
You may have gotten used to my habit of writing about some special, non-trivial Java feature or usage. This time it will be a little different, at least to start. This is a video tutorial about object initialization. We have an interface. Then we have an abstract class that implements the interface and a concrete class that extends the abstract class. They do nothing except write some strings to the console when they are executed so we can see what order they are executed. They have static initializer blocks, wherever it's possible, non-static initializer blocks, and constructors. By the way, do you know, and be honest with yourself, whether it's permitted to have a static initializer block inside an interface? If you know Java very well but you cannot answer that question with absolute certainty, it will not hurt to watch this 9-minute tutorial.


Continue reading this article »