Archive for November 2014

Problem Set Chapter 6 (Programming Language Concept)

Rabu, 05 November 2014
Posted by Andreas Kwan
  1. What are the arguments for and against Java’s implicit heap storage recovery, when compared with the explicit heap storage recovery required in C++? Consider real-time systems.
Answer :
Implicit eliminates the creation of dangling pointers. Disadvantage : cpu-time to do recovery, sometimes when there’s plenty of heap storage so recovery isn’t necessary.
  1. What are the arguments for the inclusion of enumeration types in C#, although they were not in the first few versions of Java?
Answer :
Java are strongly typed in the same sense as Ada. Types can be explicitly cast, which could result in a type error. However, there are rules of a language have an important effect on the value of an arithmetic operator with one floating-point operand and one integer operand is legal. The value of the integer operand is coerced to floating-point, and a floating point operation takes place. This is what is usually intended by the programmer.
  1. What would you expect to be the level of use of pointers in C#? How often will they be used when it is not absolutely necessary?
Answer :
In C#, memory address pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run.
  1. What array operations are provided specifically for single-dimensioned arrays in Ada?
Answer :
There are specifically a array operations provided for single-dimensioned arrays in Ada, it is “Catenation” specified by the associative array.
  1. Define row major order and column major order.
Answer :
For row major order, the elements of the array that have as their first subscript the lower bound value of that subscript are stored first, followed by the elements of the second value of the first subscript, and so forth. If the array is a matrix, it is stored  by rows.For column major order, the elements of an array that have as their last subscript the lower bound value of that subscript are stored first, followed by the elements of the second value of the last subscript, and so forth. If the array is a matrix, it is stored by columns.
  1. What is an access function for an array?
Answer :
Access function maps subscript expressions to an address in the array.
  1. What are the required entries in a Java array descriptor, and when must they be stored (at compile time or run time)?
Answer :
In Java all arrays are fixed heap-dynamic arrays. Once created, tese arrays keep the same subscript ranges and storage. Secondarily, Java supports jagged arrays and not rectangular arrays. Being a fixed heap-dynamic array the entries will be established and fixed at run time.
  1. What is the structure of an associative array?
Answer :
The structure of an associative array is the unordered collection of elements indexed by an equal number of KEYS.
Welcome to My Blog

Mengenai Saya

Foto saya
Hanyalah salah satu manusia yang hidup di dunia ini

Popular Post

Blogger templates

Diberdayakan oleh Blogger.

Total Tayangan Halaman

- Copyright © BlogOfCommoners -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -