Java Glossary

Last updated 1998 July 23 by Roedy Green ©1996-1998 Canadian Mind Products.
Stuck in a frame? Click here to break out.

C

C++
The forefather of Java. You can call C++ routines from Java via native method calls.
cab files
Microsoft's proprietary cabinet files. They have the same function as zip and Java's JAR files.
CACAO
a 64-bit Java JIT for the DEC Alpha computer. See JIT.
Café
Symantec's IDE for Java which includes a class browser, a compiler and JIT for Windows 95, NT and the Mac. There are three versions, Café, Visual Café, and Visual Café Pro (includes Sybase (Watcom) SQL Anywhere engine). See Visual Café Pro
Café studio
Symantec's Resource editor for Java which is similar to the Microsoft App Studio or Borland Resource Workshop for C++.
Caffeine
a competitor for CORBA and RMI from Visigenic.
Cafi
See Café. The accented letter é turns into an i when the high bit of 8-bit characters is dropped.
CAL
X3M Solution's Container and Algorithm Library.
calendar
See leap year, BigDate.
callback
Java does not have procedure variables to implement callbacks the way C does. There are four basic techniques to fake a callback function.
  1. Subclassing. Subclass the calling class with an overridden callback method.
  2. Delegation via subclassing. Pass the caller a subclassed Callback delegate object that knows how to invoke the callback methods(s).
  3. pass the caller a Callback delegate object that implements an interface for the callback method(s).
  4. Use inner classes to define an anonymous callback class, instantiate an anonymous callback delegate object, and pass it to the method all in one line.
See delegate, inner classes.
call by value
See parameters.
call by reference
When you call a method, the method sees a pointer to the callee's objects, not a copy of the objects. Thus any changes it makes to the object are made to the caller's object. See parameters.
call by value
When you call a method, the method sees a copy of any primitives past to it. Thus any changes it makes to those values have no effect on the caller's variables. This also applies to references passed as parameters. The caller cannot change the caller's reference variables, but it can change the fields in the caller's objects they point to. See parameters.
CallableStatement
See Statement.
Canadian Mind Products
a not-for-profit company dedicated to thinking globally and acting globally. née Consolidated Moose Pasture. When I was a kid there was a comic strip called "There Aughta Be A Law" that often featured a rag tag company called Consolidated Moose Pasture. I told my three sisters that when I grew up I was going to have a company called CMP. We would sue people who made fun of us. Back in 1985, when Byte magazine asked to publish an article on Abundance, my "public domain powerhouse" home-brew computer language, they asked what CMP stood for. I couldn't tell them the truth or they might change their mind about publishing, so on the spot I stammered out a fresh interpretation of the acronym. At one point CMP was 8 people, but at this point it has dwindled down to just me, Roedy Green and one computer. Unfortunately I still have not found an FTP site for the public domain BBL 32-bit DOS Forth Compiler or the Abundance compiler.
Circa 1972 I watched a master Chinese painter. He worked for what felt like hours doing nothing but pecking away at his brush. Suddenly he stabbed the brush onto the paper. Everyone jumped. He pulled the brush away and there was an intricately detailed picture of a bird and chrysanthemum produced "instantaneously". In a similar way, I still have hopes my work with BBL and Abundance may be similarly translated to Java.
cancel
To withdraw an electronic message you posted to an Internet Usenet newsgroup.
canvas
a rectangular region on which you can draw lines and geometric shapes or text. Think of it as a blank canvas where you can roll your own drawing with precise positioning. In contrast a panel is used to place components very roughly with the layout manager figuring out the precise positions. Panels invisibly handle all sorts of events inside the native GUI where you can't get at them. Canvasses let you process them raw. A canvas is the raw material upon which you can build your own custom components. It receives all the raw mousing events. Panels in contrast see only a few. You could think of a canvas as a stripped down panel with the container baggage taken off it. See panel.
carrier
the drone sound two modems sing to each other when they have nothing better to say. The carrier lets each modem know the other is alive and well. By modulating (warping) the carrier's frequency (pitch), phase and/or amplitude (loudness) one modem can signal to the other. The carrier is equivalent to sending ones.
CardLayout
layout manager that flips between several possible screen layouts, as if they were on cards, and it shows you only one card at time. This is the closest thing the current AWT has to a tabbed dialog, except there are no tabs for the user to click. A mechanism for controlling which card should show has to be provided separately, e.g. via some buttons. See Layout
Cascade HTTP
a Java servlet womb. See servlet.
cast
There are two kinds of casts. Primitive casts e.g. (short) would convert to a short integer. Mollifying casts assure Java that a general reference is actually something more specific, a subclass of that general type. E.g. (Dalmatian) DogRef assures Java that the DogRef pointer really points to a Dalmatian. Java checks that this is indeed so before proceeding. See conversion.
Castanet
Marímba's application and data distribution system in Java and for Java. See Marímba. Using a metaphor of broadcasting over channels to tuners, Castanet users automatically get just the necessary updates of data and software whenever they connect.
cbVan
a Java and C++ source code beautifier / pretty-printer / indent / reformatter.
censorship
the belief that other people would do something foolish if they knew the truth. The problem with censorship is ×× ×××'× ××× ××× ×××× ××× ×××.
CCITT
Comité Consultatif International Télégraphique et Téléphonique (CCITT) is the French acronym that translates to the International Telegraph and Telephone Consultative Committee. It is an international body centred in Geneva that has created the world wide modem standards. Canada uses Bell standards for 300 and 1200 BPS modems, and CCITT standards for all faster modems. It renamed itself to ITU-TSS -- International Telecommunications Union - Telecommunications Standards Sector.
CFV
Call For Votes. The instructions on how to vote on breaking up the comp.lang.java newsgroup into smaller ones are in: ftp://ftp.uu.net/usenet/news.announce.newgroups/comp/comp.lang.java-reorg. The vote is already over, but eventually Java will need to be split further.
CGI
Common Gateway Interface. A non-Java technique of sending data from HTML forms in browsers to server programs written in C, Python, Tcl or Perl. They typically do data base searches or process the data in HTML forms and send back MIME. Java can simulate the form on the client side, or replace the C with servlets on the server side. See servlet, cookie.

Ch

chain of responsibility
See design patterns.
Chami Code Colouriser
An online service that will take Java source code and convert it to HTML, complete with colours and bold.
character
a single letter of the alphabet, a piece of punctuation or a digit.
charge along
a technique first explicitly formulated by the late Tom Meikle for persuading experts to give you information they would normally be too impatient to provide and for worming proprietary trade secrets out of people. There are two variants the rude and the polite. To use the rude form, you privately or publicly post something of this form:"You, Ms. Expert are totally incompetent. Obviously your statements are patently false." Ms. Expert then wants to put this insolent puppy in his place. So she spends an hour composing a detailed reply point by point meticulously defending her position and in the process explaining it in great detail. To use the polite form, you privately or publicly post something to the effect "Here is my understanding of how X works. It might work via option a... or option b... or perhaps something entirely different. However, my thinking now is I believe it works via option a." If you guessed incorrectly the experts will have an uncontrollable itch to correct you. They can't stand the thought of misinformation being disseminated. By doing the work of elaborating some possible options, you save the expert time. She can answer with multiple choice. She also has a clearer idea of your level of expertise so she knows how terse she can be in her reply. So if somebody flames you, you can reframe that (as the NLP people would say) into a compliment. Perhaps they consider you an expert and are just trying to worm information out of you using the charge along technique.
cheat sheet
I have composed a cheat sheet summarising the Java syntax.
check digit
Dating back to keypunches, id numbers have an appended check digit used to ensure that the number was keyed properly. The various types of bar code such as the UPC you see on grocery items all have a check digit. The basic idea is if you transpose or mistype a character in entering a number the checksum won't match the one that should be there according to the calculations. One of the most common schemes is called mod 10, used for all credit card numbers and the Canadian SIN (Social Insurance Number). The Stiles site maintains pointers to all kinds of information related to check digits. Here is how to calculate a mod 10 check digit by the manual method:
e.g. to compute the expected check digit 7 for: 706-511-227

7   0   6   5   1   1   2   2   7
  * 2     * 2     * 2     * 2
---------------------------------
7 + 0 + 6 +1+0+ 1 + 2 + 2 + 4 = 23

23 MOD 10 = 3

10 - 3 = 7 -- the check digit


Note that the digits of the multiplication results must be added before doing the sum. Here is method more amenable to computer calculation:
e.g. to compute see if the check digit is as expected: 706-511-227

7   0   6   5   1   1   2   2   7
    z       z       z       z
---------------------------------
7 + 0 + 6 + 1 + 1 + 2 + 2 + 4 + 7 = 30

30 MOD 10 had better = 0

where
int z (int digit)
   {
   // 0->0 1->2 2->4 3->6 4->8 5->1 6->3 7->5 8->7 9->9
   if (digit == 0) return 0;
   else return (digit*2-1) % 9 + 1;
   }
checkbox
a box the user can mark as on or off. A radio button is a checkbox in a checkbox group where only one button may be pushed on at a time. Checkboxes can be used as choices or combos. See choice, combo, list, checkbox group.
checkbox group
a group of radio buttons that automatically turn off when another of the group is selected. See checkbox.
CheckOut
Giaco's $1500 Java-based package for setting up a web store.
choice
a pulldown menu not part of the top menu bar, typically used to select between options rather than to invoke a command. A choice component only displays all the possible options when clicked. See list, combo.
Cinnamoney
CHRP
Common Hardware Reference Platform. The standards for physical dimensions of boards, power supplies, disk drives etc. It allows standard parts to be interchanged between PCs, unless the vendors, (notably Compaq and Apple) have violated them so they can sell you outrageously-priced proprietary spare parts.
Thought Inc's classes for handling money with arbitrarily long number values.
class
A class in Java is much like one in C++. It consists of a group of related methods and variables lumped together under one name. The static class variables are for class-as-a-whole data. They are allocated only once at load time and are shared by all instances of objects of that class. The instance variables, are allocated inside each object of that class. Static class methods work when there is no current object. They can only reference static class variables and static methods, unless of course they allocate an object and then use explicit references to the instance variables. Instance methods work by default on the fields of the current this object. There can be only one public class in each source file. If your class was called HelloWorld the name of the source file must be precisely HelloWorld.java with every letter exactly matching even in case. In Java there is no such thing as a method or variable that does not belong to some class. Java comes with a builtin set of classes arranged in a class hierarchy.
Class.forName
There are Class objects (objects of class Class) that represent classes (including arrays), interfaces, and primitives. The Class.newInstance method lets you create new objects of that class without requiring a variable declared specifically of that class. This allows code to be much more open ended than in other languages, with new variants added dynamically. The Class.getName method lets you display the class name. There are also methods to discover the details of the fields and methods associated with the class. You can discover the Class of any object with Object.getClass(). You never create your own Class objects, but you can get a reference to the one the system has created for any class. In JDK 1.0 you find a class object like this:
Class c = Class.forName("java.lang.String");
In JDK 1.1 you have the option of getting at them more efficiently like this:
Class c1 = java.lang.String.class; // gets String class
Class c2 = double.class; // gets pseudoclass representing double primitive.
Class c3 = Double.class; // gets Double wrapper class
Class c4 = Double.TYPE; // gets underlying double primitive.
class instance method
See instance method, method.
class instance variable
See instance variable, variable.
class method
a static method in some class. It may not access the instance variables of that class, only its static variables. Further it may not invoke instance (non-static) methods of that class unless it provides them with some object. See static, instance.
class variable
a static variable in some class. There is only one copy of this variable to serve all objects of the class, not one per object. See static, instance.
Class1/EIA-578
A standard for the sounds two FAXes make talking to each other.
Class2
A standard for the sounds two FAXes make talking to each other. It requires slightly more intelligence on the part of the two faxes. However, its design is too inflexible, so even faxes capable of class2 are usually run in class1 mode.
CLASSPATH
An environment variable that tells the Java compiler where to look for class files to import. Unlike C++, Java compilers examine compiled code rather than source header files to learn how about how to invoke the various methods. The runtime also uses the CLASSPATH to find the class files to execute. The Symantec compilers ignore the usual SET CLASSPATH= and take one from the SC.INI file instead. Class files may be standalone, combined in zip files or combined in jar files. Java looks for class files in any directories mentioned in the CLASSPATH, but only searches jar and zip files if they are explicitly mentioned. A typical CLASSPATH statement might look like this:
SET CLASSPATH=.;D:\VCP\BIN\COMPONENTS\SYMBEANS.JAR;D:\VCP\JAVA\LIB\CLASSES.ZIP;D:\VCP\JAVA\LIB;D:\MyStuff
You might think that you could have an import like this:
import VCP.BIN.COMPONENTS.SYMBEANS.SomePackage.MyClass
However, you cannot respecify anything already mentioned in the CLASSPATH. You just give the low levels of qualification like this:
import SomePackage.MyClass
The SomePackage is the internal directory name stored inside the jar file. Similarly you might try to get at the class in D:\MyStuff\MyPackage\Great\MyClass.class with the following import:
import MyStuff.MyPackage.Great.MyClass
That will not work. You may only specify the low order qualification like this:
import MyPackage.Great.MyClass
Basically the rule is, your package name cannot provide rendundant information that the CLASSPATH has already provided, and together between the CLASSPATH and the package name, you have to fully qualify the package name. You can check the CLASSPATH setting my typing:
echo %CLASSPATH%
under Win95 or
echo $CLASSPATH
under Unix.

Symantec Visual Cafe hides its CLASSPATH in C:\VCP\BIN\SC.ini. Internet Explorer hides its CLASSPATH in the registry under HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Java VM. Netscape uses the CLASSPATH in the standard SET environment. Windows 95 controls the environment with SET CLASSPATH= in autoexec.bat. Linux controls the environment with export CLASSPATH= in your .bashrc file. NT controls the environment with the Control Panel / System / Environment settings. One would think a platform independent language would have a platform independent way of controlling the CLASSPATH, but it doesn't. Symantec's is closest.

In Linux and NT under bash, the elements of the classpath are separated by colons. In Win95 and standard NT, they are separated by semicolons. Somebody deserves a major raspberry.

Beware of inserting extra semicolons in your classpath. Everything to the right will be ignored!, leading you to pull out your remaining hair in frustration wondering why java can't find the classes. You must have exactly one semicolon between elements, no lead/trail/extras.

Just to keep you on your toes, in JDK 1.1 putting classes.zip on the CLASSPATH is optional. In 1.2 it is an error.

See java.exe for a detailed discussion of how Java.exe combines package names, class names and the classpath to find the classes.

clean room
Clean room has three meanings:
  1. Integrated circuit chips are manufactured under super clean dust-free conditions in a "clean room" with special air pumps and filters to clean out the dust.
  2. By analogy, "clean room" refers to a way of writing software. When a company wants to make a clone of some existing product, they are concerned that they will be accused of reverse engineering. So they lock the programmers away, and never even let them look at the product they are copying. A separate team studies the behaviour and specifications of the product to be copied. All conversations between the two teams are recorded. This way the company can prove in a court of law that it created the clone without reverse engineering. Companies that write JVM interpreters in the clean room style would not owe Sun any royalties.
  3. "Clean room" also refers to a technique of writing reliable code. The specification team uses a formal specification language to define the system. The specification language should be mathematically provable or verifiable. The developers are expressly forbidden to compile and execute their code. Instead, the development team holds extensive walkthroughs and functional verification exercises: the goal is to address every known design possibility in the code. If this team has done its job, when they turn their code over to the certification team, it should compile cleanly and run perfectly the first time.
See reverse engineering.
Clipper
The Clinton administration is attempting to force everyone to use a government encryption algorithm for sending confidential information. It is implemented in an electronic device called a Clipper chip. (Clipper here has no relation to the dBase clone.) There is great resistance because:
  1. The government is insisting on having a back door key so they can snoop on conversations.
  2. No details of how the Clipper chip works are being given out. It may not be as secure as the government claims.
  3. In practice, flouting the law will be easy. Criminals will easily flout the law and go unpunished. The government will eventually snoop on those it has no business snooping on -- for example political rivals. We would get all the costs with none of the benefits.
clone
It can sometimes be faster to make a copy of an existing object than to create a new one and initialise it. The method to do this is called clone(). If you want to make objects of your class cloneable, you need code like this:
class Rabbit implements Cloneable{
...
public Object clone()
{
try {
return super.clone();
} catch (CloneNotSupportedException e) { return null; }
}
...
} // end Rabbit

You can then use it like this:
Rabbit r1 = new Rabbit();
Rabbit r2 = (Rabbit) r1.clone();

Note: To comply with Cloneable, clone() must return an Object not a Rabbit.

Instead of using super.clone(), you could use new Rabbit() and copy the fields one by one to the new object and return the new object. Then you don't have to mess with CloneNotSupportedException.

closure
Roughly, a closure is an anonymous function body, that can be declared and passed around as a first-class object, and which can refer to variables from its enclosing scope. The anonymous classes in JDK 1.1 provide closure-like facilities, albeit with tacky syntax. Smalltalk "blocks" are closures.
clustered index
An index where the lowest leaf level contains the data itself. This provides faster access to the data by that index.
CMP
See Canadian Mind Products

Co

Cobra
Ericsson's Cobra ADSL scheme can pump 512 Kbits/sec over ordinary copper phone lines, and still leave sufficient bandwidth to support ordinary voice service. Technology such as this along with cable modems will provide much faster Internet hooks. Most modems now give only 28 Kbits/sec access.
CocoBase
Thought Inc's bridge from the object world of Java to the relational table world of SQL. You can think of it as a more Javaesque JDBC. The embedding of SQL in Java is much more elegant than in raw JDBC. CocoBase comes in four pieces CocoPowder, CocoButter, CocoBeans and CocoNibs. CocoPowder lets you store and retrieve Java objects via JDBC. CocoPowder manages an Object Schema that parallels the relational one and generates SQL. CocoBeans provides CORBA-compliance. CocoNibs adds 3-tier RMI. See JDBC.
Codebook
A collection of Java source code.
Coding Conventions
Sun has dared to go were mortals fear to tread and has laid down a set of coding conventions -- how to lay out your code, where to break lines etc. I know of no tool to take messy code and tidy it up. Naming conventions are discussed in greater length in the online Java Language Specification . Doug Lea, author of the book Concurrent Programming in Java also has a draft coding standard. See beautifier.
Cold Fusion
a Web application development tool for Windows NT and 95 servers. It integrates databases with the Web and to build interactive Web applications for intranets or the Internet. See HomeSite.
Collections
The Collection interface is a new feature of JDK 1.2. A collection in data structure terms, is a group of elements. Some types of collections that derive from Collection include the following: The new java.lang.Comparable interface makes it easier to sort Collections. Even String implements it.
Collections of Source code
The best way to learn Java is to study working examples of source code.
Color
Often your colours will be mangled when you run them on some other platform or browser than the one you developed with. Some platforms only support 256 colours. Colours with the following magic values as the R G or B component are most likely to survive unmolested: 0, 51, 102, 153, 204, 255 or 0x00, 0x33, 0x66, 0x99, 0xcc, 0xff. See ColorSaver.
Colorado Software Summit
A Java technical conference held in the fall in Keystone Colorado. I attended and spoke at the 1997 conference. It was quite different from the usual conferences where the salespeople bore you to death with slides. Here they keep the sales types out. It was all developers (including those from the big companies like IBM, Netscape and Oracle), talking tech, and sharing code, from 7 AM to 9 PM each night. The conference organisers delivered far more than they promised. The "continental breakfast" and "hot lunch" were mountainous feasts. They were so huge, almost no one ate dinners as well. The accomodations were luxurious. My suite had two floors, a working fireplace, fully equipped kitchen, two TVs and access to a hot tub.
ColorSaver
Free source code to ensure Color objects are shared rather than duplicated.
COM
COM stands for Component Object Model. Microsoft's interface specification for OLE hooks into Java. COM also covers how pluggable component applications fit together. Microsoft is now treating OLE and COM as almost synonymous.
COM1:
PCs have ports usually named COM1: COM2: COM3: and COM4: through which data can be imported or exported via modem. They are simply connectors where you can attach a modem.
combo
any sort of component that asks you a multiple choice question and lets you select one or more options. Also a choice list that lets you write in your own choices not on the list. The java.awt.List can act either as a choice or combo depending on whether setMultipleMode is set. See choice, list, checkbox, checkbox group.
command
See design patterns.
commit
SQL term for making the database changes done during a transaction permanent. See rollback.
companion
generic name for a small hand-held device that integrates many special purpose computer functions, e.g. pedestrian's companion. The term can also be more generally used for a portable personal computer interface as in surgeon's companion that may be worn or embedded. The etymology comes from Clifford Simak's tale about a man who befriended an alien plant and in return received a companion as a gift.
compatibility
In theory Java is a write once, run everywhere. However, it does not always work both because of bugs in the various platforms and because of deliberate incompatibilities. Here is a table of known major problem areas on the various current platfoms:
platformproblems
JavaSoft JDK 1.1.5 ok
JavaSoft JDK 1.1.6 load problems with the JIT in Win95/NT. Problems with reading serialised files.
Jbuilder 2.0 ok
Microsoft Internet Explorer 4.01 Not only does IE 4 leave out the RMI classes, its security manager prevents you from using Sun's. It complains that you are trying to access "localhost" which it considers to be a different host from the nameless one it loaded the applets from. Problems loading jar files. Microsoft wants you to use proprietary cab files instead.
Microsoft Internet Explorer 4.01
with the Activator Java Plug-in
ok
Netscape Communicator 4.05 ok. In earlier versions the JIT fails. You can turn it off by deleting the jit3240.dll file.
Netscape Communicator 4.05
with the Activator Java Plug-in
ok
Supercede 2.01 Needs registry entries like this
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.1\JavaHome
"C:\Program Files\Supercede\Jre"

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime
Environment\1.1\MicroVersion "4"

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime
Environment\1.1\RuntimeLib "C:\WINNT\System32\sc30rtl.dll"
Symantec 2.5 Visual Cafe
JIT activated
ignores standard classpath, uses SC.INI.
Symantec 2.5 Visual Cafe
JIT disabled
SET JAVA_COMPCMD=DIS
ignores standard classpath, uses SC.INI.
Complex
Java has no built-in support for complex numbers. Alexander Anderson has written a Complex class.
component
a generic term for the various doodads you can place on your windows, including buttons, listboxes, choices, checkboxes, checkbox groups, menus ... Component is also the name of a class that contains methods common to all components such as setVisible and setForegroundColor.
composite
See design patterns.
compression
Since data communication lines are so slow, it is important to use every possible scheme to use them efficiently. Compression schemes can reduce the amount of data that needs to be sent. The receiver fluffs the data back up to its original size. Compression schemes depend on the fact that most messages repeat words or phrases and use some letters of the alphabet more frequently than others. Compressors invent a scheme of short abbreviations for commonly used items.
condition variable
According to Achim Gratz monitors are insufficient if a thread needs to wait inside a monitor until a condition is met: this thread is inside the monitor and so no other thread can enter and change the condition - a deadlock is the result. Condition variables are used to block a thread inside a monitor (wait ()) and allow another thread to enter the monitor. When the condition that has led to the blocking changes this is signalled to blocked threads. Java allows distinction between deblocking a single thread (notify ()) and unblocking all threads waiting on the CV (notifyAll ()). This feature is of dubious value if not accompanied by additional program logic (you don't have control over which thread of the wait set gets its turn) and beginners are probably best off using notifyAll () only. See monitor, semaphore, synchronized, CV
connection
In dbAnywhere, a connection refers to the connection to the SQL Anywhere database. See session, dbAnywhere.
constants
Java is sloppy in its terminology. It muddles together the concepts of literals and constants. See literals for how to specify strings, integers etc. Final in Java means a variable that will not change after it is initialised. The associated keywords with a named constant are static final. ENUMs in C++. They are constant values that have alphabetic names, e.g. Math.PI. For most practical purposes constants in Java are called "static final variables". However, only those static final variables whose value can be computed at compile time are true constants. Only true constants can be used as case labels. Note that constants always need to be qualified with the classname except in code inside the class. To further confuse the matter, the language specification refer to static final variables as "values" not constants. To avoid having to spell out every reference to a constant with a fully qualified name e.g. MyClass.MAX_ROWS, define your constants in a dummy interface without any methods. Whenever you "implement" the interface, you inherit all the constants and you can use them without qualification e.g. MAX_ROWS. See literal.
constructors
Constructors are just static methods that return a new object. However they have a number of special properties.
  1. They have the same name as the class.
  2. Constructors are not inherited. This means you have to write out reams of dummy constructors for every subclass that just invoke the corresponding super(xxx).
  3. If you don't define the default constructor, Java will "write" one for you.
  4. If you don't call super(xxx) as the first line of code in a constructor, Java will automatically insert it for you.
  5. They return an object, yet your are not allowed to declare that fact.
  6. It is possible to have ordinary static or instance methods also with the same name as the class. The compiler distinguishes these from true construtors because they have an explicit return type. Be careful!
  7. You don't specify new inside your constructor. The space for the object has already been allocated before your constructor started to execute. All you are doing is initialising fields.
  8. You don't return this. The constructor does not return a value. A ordinary static method that created objects would.
  9. If you wanted to handle your own memory management, e.g. recycle used objects, you would do this with an ordinary static method, not a constructor.
  10. Be very careful calling any methods inside your constructors. If subclasses override them, you will be invoking the subclass's version, which may be attempting to use fields that have not been initialised yet.
See new.
container
generic term for a graphical element that has subcomponents. Windows, panels, frames and dialog boxes are all types of containers. Container also refers to any class that holds or organises other objects such as trees, bags and Vectors. See the Container and Algorithm Library.
contravariance
Java does not make the same distinctions that other languages refer to as contravariance. Here is a definition from Greg Weeks weeks@orpheus.dtc.hp.comSuppose I have the following interface:
interface Dog_printer {
void print(Dog d);
}

Suppose further that a class Animal_printer implements the method:

void print(Animal a);

Can I say that Animal_printer implements Dog_printer? Logically, I should be able to. Anywhere that a Dog_printer is expected, I can supply an Animal_printer, and the dog will get printed. (Because all dogs are animals.) So, logically, there is the relation:

Animal_printer is a subtype of Dog_printer.

Although logically correct, this is weird looking. Then again, something that can print any animal "extends" something that can print any dog, so maybe it isn't so weird. Anyway, to determine whether Animal_printer is a subtype of Dog_printer, we have used the "contravariant argument rule". Similarly, there is a "covariant return value rule" that would state that:

Dog_creator is a subtype of Animal_creator.
See contravariance.

control
"Control" in MS-Windows-speak is "component" in Javanese. See component.
convert
see conversion.
conversion
How do you convert Strings to ints, vice versa and the like? You can't always simply cast them. Java has a rather chaotic naming convention for the various routines to do the conversions. Look for candidate static and dynamic methods on both the source and target classes, and related wrapper classes like Integer. Likely conversion method names are valueOf, toString, parse???, ???Value, to???. I have composed a 16x16 matrix crib sheet to tell you how to convert any of the 16 basic types into any of the others. It also shows you how to get left leading zeros. I have also written an amanuensis applet in Java, available with source code, that will generate Java source code for any of the 256 possible conversions between the 16 basic types. You can then cut and paste the result into your code.
cookie
A cookie is a technique a CGI server can use to store information in an HTTP client for later retrieval to remind itself where it was in dealing with the client. You could think of a cookie as a laundry ticket that the client gives back to the server to remind it where it was in the middle of a displaying a long list of search results, for example. When you do a search and see URLs in your browser like "http://www.lycos.com/cgi-bin/pursuit?first=11 &maxhits=10 &minterms=1 &minscore=0.01 &terse=standard &ab=the_catalog &query=turtles" -- the "pursuit?first=11 &maxhits=10 &minterms=1 &minscore=0.01 &terse=standard &ab=the_catalog &query=turtles" part is a cookie. The browser records the cookies with with the site they came from, an expiry date, the cookie name and its value.
co-ordinates
For mouse events, drawing geometric shapes, and placing components with absolute co-ordinates in the null layout, the origin 0,0 is the upper left corner of the canvas. A co-ordinate is given as (x,y) where x is the horizontal displacement to the right in pixels and y is the vertical displacement downward in pixels. The measure is relative to the containing panel, not the entire screen. Note this is not the traditional mathematical x,y notation. It is similar to the PostScript co-ordinate system. When you place an object on the screen, you specify the location of its upper left corner. When drawing an ellipse, you would specify the position of the upper left corner of a bounding rectangle surrounding the ellipse, not the center of the ellipse. When placing text you specify the top left corner of where you want the text to appear.
The 0,0 upper left corner is hidden under the menu bar. You have to account for it and leave room in designing your layouts.
For GridBagLayouts the origin 0,0 is the upper left corner of the enclosing container, not necessarily the entire screen or the application window. In GridbagLayouts the first co-ordinate measures rows -- vertical displacement downward in cells, and the second columns -- horizontal displacement to the right in cell widths. GridBagLayout then adjusts the size of the various rows and columns and precisely positions components within the rough cells. The programmer usually does not work with precise placement. She uses layouts to specify relative position and allows the layout manager to compute the exact placement.
Routines often ask for the width and height of a bounding box, in that order. Ordinary English is confused about the usual order. We often say height and width, then describe the dimensions of a piece of paper as 8½x11 width x height. For some reason, drawRectangle and brothers deliberately draw rectangles one pixel taller and wider than requested.
Because co-ordinates are measured in hardware-dependent pixels, images generated by Java programs will be smaller when they are displayed on high resolution displays. At this point, no one is worrying about scaling to account for this resolution quality evolution despite the fact PostScript has been tackling the problem for over a decade. See GridBagLayout.
CORBA
Common Object Request Broker Architecture is the OMG platform-independent technique for programs running on different machines to communicate with each other. See distributed objects. Normally you would use lighter weight RMI, unless you are tying into legacy C++/Corba systems.
correlated subquery
In SQL, a query that cannot be evaluated independently, but that depends on the outer query for its results. The inner query has to be repeated once for each row that the outer query returns. These drive some simple-minded SQL engines insane.
covariance
Java does not make the same distinctions that other languages refer to as covariance. See contravariance
country codes
ISO 3166 defines two-letter, three-letter and numeric standard abbreviations for each country. These are always written in upper case. E.g. Australia is AU, AUS or 036.
CRC
Cyclic Redundancy Check. CRCs are a popular method of if transmissions have been garbled. Roughly speaking the sender treats the message like a giant binary number. It divides it by a magic number using a special kind of division where you use XOR instead of subtraction (division by a polynomial for the mathematically inclined). Then it tacks the computed remainder on the end of the message. Why? The receiver repeats the calculation. If any of the bits of the message have been garbled, a different remainder will pop out of the calculation and the receiver will know to request a new copy of the message. If all arrived intact, the calculated remainder will the same as the appended "checksum".

More generally CRCs are a technique for creating a signature from a string of bytes. If any of the bytes changes, then most likely the calculated signature would change too. CRC's are used to verify a message has been sent unmolested and for hashCodes. JDK 1.1 offers the java.util.zip.Checksum interface and CRC32 and Adler32 classes that implement it. CRC32 produces a classic 32 bit result using native code for speed. The CRC calculation can be thought of as polynomial division, with the individual bits as coefficients, or as XOR division that ignores carries. It works much like treating the message as a giant binary number and dividing it by some prime number and taking the remainder as the signature, except the calculation is easier for computers. Adler32 uses a even more simplified and speedy algorithm that produces almost as satisfactorily "random" a result. Here is how to use the undocumented 16-bit CRC built into Java 1.0.2.

import sun.misc.*;
...
byte[] b = new byte[200];
...
// create a new CRC-calculating object
CRC16 crc = new CRC16();

// loop, calculating CRC for each byte of the string
for (int i=0; i<b.length; i++)
  {
  crc.update(b[i]);
  }
short result = (short) crc.value;
The innermost loop of a 16-bit CRC calculation looks something like this:
work = (work >> 8) ^ CRCTable[(work ^ b) & 0xff];
CRCTable is a precomputed scrambler table, ^ is the XOR operator. work is the CRC being developed. b is the next byte to be included in the calculation. Here is how the scrambler table is initialised. Usually we would use poly = 0x8408, the 16-bit CCITT polynomial.
for (int i = 0; i<256; i++)
    {
    int crc = i;
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    crc = (crc >> 1) ^ ((crc & 1) ? poly : 0);
    CRCTable[i] = crc;
    }
Crema
Creama is a tool to prevent reverse engineering of your *.class files. It shrouds the names of your classes and variables by converting them all to numbers. Unfortunately the young Dutch author Hanpeter van Vliet died of cancer. See shroud, Mocha.
credit card validation
The Java Commerce API is still vaporware. In the meantime you could work through a commercial service.
cross join
See join.
cryptography
Techniques for foiling those who would intercept to read or alter your mail. Also techniques to prevent people from forging mail from you. These are particularly important in net money transfers. See Avalanche, JCrypto, PGP, encrypt.
css
Cascading Style Sheets. A feature of HTML 4 where you can specify your formatting in one place and have it propagated, e.g. so you can decide in one place how all headings should look. You can have layers of style sheets that override each other. Here is an example of the sort of thing you can specify:
<STYLE type="text/css">
H2, H3 {font-family: Arial,Helvetica,sans-serif;}
BODY {background: white;}
PRE, TT {color: #333333;}
TH {background: tan;}
</STYLE>
Cup O' Joe
An on-line Java source code store, not to be confused with JOE.
CV
acronym for Condition Variable. See Condition Variable, monitor, semaphore, mutex, synchronized.




HTML Checked! award
Canadian Mind Products The Mining Company's
Focus on Java
Best of the Net Award
You can get an updated copy of this page from http://mindprod.com/jglossc.html