January 21, 1999

Inheriting From the Object Class

The Object class in Java is a superclass for all other classes defined in Java’s class libraries, as well as for user-defined Java classes. In object-oriented terms, an object is an instance of a class. Note the distinction between the “Object class” and a Java “object”: A Java object is

Detecting Your Machine’s Endian

The term endian refers to the way a computer architecture stores the bytes of a multi-byte number in memory. If bytes at lower addresses have lower significance (Intel microprocessors, for instance), this is called little endian ordering. Conversely, big endian ordering describes a computer architecture in which the most significant

Initializing a Union

It is possible to initialize a union. Yet, unlike struct initialization, the initialization list of a union must contain a single initializer that refers to the first member in the union: union Key { int num_key; void *ptr_key; char name_key[10];};Key a_key = {5}; //first member of Key is of type