Thursday, June 27, 2013

Concepts of Programming Languages Chapter 12


Concepts of Programming Languages Chapter 12


Name            : Erland
NIM              : 1601218035
Lecturer       : Tri Djoko Wahjono, Ir., M.Sc. (D0206)
Assignment  : Concept of programming languages Chapter 12

Review Questions


       1. Name two functional languages that support object oritented programming
             Answer :  
C++ and Java
       2. What are the problems associated with programming using abstract data type?
            Answer : 
– the features and capabilities of the existing type are not quite right for the new use.
– the type of definitions are all independent and are at the same level
       3. What is the advantage of inheritance?
             Answer :
programmers can begin with an existing abstract data type and design a modified descendant of it to fit a new problem requirement
       4. What is message protocol?
            Answer :
the entire collection of methods of an object
       5. What is an overriding method?
             Answer : 
A method that overrides the inherited method 
       6 .  Explain how information hiding is provided in Ada package.
             Answer : 
Data type representations can appear in the package specification but be hidden from clients by putting them in the private clause of the package. The abstract type itself is defined to be private in the public part of the package specification. Private types have built-in operations for assignment and comparison for equality and inequality.
        7.   What is dynamic dispatch?
              Answer:
Dynamic dispatch is the third characteristic (after abstract data types and inheritance) of object-oriented programming language which is a kind of polymorhphism provided by the dynamic binding of messages to method definitions.

        8.   What is an abstract method? What is an abstract class?
              Answer : 
An abstract method is an implemented method which all of descendant class should have and it is included in Building. An abstract class is  a class that includes at least one abstract method.

       10. What is an inner class?
             Answer :
Non static classes that are nested directly in another class
       11. What is the message protocol of an object?
             Answer : 
The message protocol of an objects are all the methods.
       12. From where are Smalltalk objects allocated?
             Answer : 
Smalltalk objects are allocated from the heap and are referenced through reference variables, which are implicitly dereferenced.
       13. Explain how smalltalk messages are bound to methods. When does this take place?
             Answer :
all computation is through message. Replies to messages have the form of objects and are used to return requested or computed information or only to confirm that the requested service has been computed