Constructor - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Constructor.

Constructor - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Constructor.
This section contains 509 words
(approx. 2 pages at 300 words per page)
Buy the Constructor Encyclopedia Article

A constructor is a special function belonging to a class that builds objects of that class from nothing. Its chief purpose is to take an arbitrary collection of bits and bytes in the computer's memory and turn them into a valid object, complete with initialized internal data members and pointers to the code that represents the functions the object owns. A constructor is called automatically at the time an object is created.

The constructor method is typically named after the class for which it builds objects; thus the constructor of a class called "lunchBox" will also be called "lunchBox()."

In Java and C++, probably the two most common object-oriented programming languages, a class must have at least one constructor, but it can have many more. This is because Java and C++ both support "function overloading," which means the compiler can distinguish between functions that have the same name...

(read more)

This section contains 509 words
(approx. 2 pages at 300 words per page)
Buy the Constructor Encyclopedia Article
Copyrights
Gale
Constructor from Gale. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.