SelfStudyJavaCourse/week1 at master · Dmitry404/SelfStudyJavaCourse

Hi folks,

As we already mentioned, we’re going to use Bruce Eckel’s book “Thinking in Java”. There is the “Introduction to Objects” chapter (pages 23 - 60) in the book you should read first. After you’ve done, answer the following questions:

  1. As you probably know, there was the first true object-oriented language named Smalltalk. A lot of object-oriented programming languages, including Java, were influenced by Smalltalk. In his book Bruce mentioned Alan Kay, who was one of the inventors of Smalltalk. Kay summarized five basic characteristics of the language which represent an approach to object-oriented programming. Please list these characteristics and explain how you understand them.

  2. How do you understand concept of classes and objects? What does the “Data Type” term mean?

  3. “An object has characteristics and behaviours”, explain how you understand this expression.

  4. When someone points out that any Data Type has an interface. What is implied there?

  5. Bruce suggests the way of thinking of a program design named “service providers”. Explain how you understand it.

Hint: mind the “cohesion” term, it’s one of the important measurements of software quality in computer programming.

  1. What are the main reasons to hide implementation? What keywords in Java can be used to achieve the hidden implementation?

  2. As you already know, there are two classes relationships: Inheritance (is-a relationship) and Composition (has-a relationship). Explain the difference between them, describe advantages/disadvantages of each approach.

  3. Bruce stated a “is-like-a” term, it’s a relationship that comes from “is-a” relationship. What is considered there? What problem do you see there?

  4. Explain Polymorphism as you understand this term. Give an example.

  5. How do you understand the “upcasting” and “downcasting” terms? Give an example.

Doing this exercise please follow the instructions you learnt in the previous lesson.

And last but not least. For those who tend to cut, copy and past, please answer a question in a way you understand it. Don’t cite the book. That’s not allowed. However you still can use or refer to the examples from the book, if you find them comprehensive enough.

Regards