C

     
case

A Java keyword, case is used inside a switch block to define a set of statements to be executed conditionally, depending on whether the case value matches the supplied switch value.



cast

To convert one data type to another. There are implicit primitive casts, in which you do not write the code to perform the conversion ”it is done automatically. An explicit primitive cast demands that you write the code to perform the cast, because you are narrowing the primitive ( putting it into a smaller container ”for example, casting a long into an int ). Narrowing conversions can cause loss of precision, which is why you must explicitly perform it.



catch

A Java keyword used to declare a block of statements to be executed in the event that an exception is thrown from code in the corresponding try block.



char

A Java keyword used to declare a primitive variable of type char . A char is used to represent Unicode character values. It is declared with single quote marks around the value, as in: char grade = 'a' ; chars are considered 16-bit unsigned integer primitives, which means that Java allows direct conversion between char and other primitive integers. Its possible values range from 0 to 65535 (or 216-1).



class

A Java keyword representing the declaration of an implementation of a particular object. Classes are used to create instances of objects. Classes define instance and static variables and methods . They specify the interface that the class implements, and the immediate superclass that the class is extending. All behavior in Java programs occurs inside classes. Every class implicitly extends the class java.lang.Object. The class java.lang.Class can provide the runtime type of an object.



class file

The file created when a .java source code file is compiled. The name of the generated file will match the name of the source code file. The class file contains bytecode to be executed by the runtime.



class method

More commonly called a static method, a class method is one that can be invoked without reference to any particular object. Defines static methods when the execution will always be the same, regardless of the particular object invoking it. For example, a method that makes a connection to a datasource is often defined statically, because it is always performed in the same way, and is always returned the same result (a database connection) regardless of what instance calls it. Invoke class methods on the class itself. For example, the Collections class contains a number of static methods for convenience, such as sort () . You invoke it like this: Collections.sort(myArrayList); . The java.lang.Math class is another class that defines only static methods (which makes sense ”the pow() method, which calculates the result of the first argument raised to the second argument, will always perform the same action).



Classpath

An environment variable indicating the location of class libraries used by the Java Virtual Machine. If you write a program that uses a particular library (for example, a JAR file that contains classes that help you convert data into PDF format), you need to put that JAR on your classpath so that the JVM can find it when it executes your code that references the classes in that JAR. Here's another common example: If you want to send an e-mail from a Java program, you can't do it using just the J2SE; you need to download J2EE, put the j2ee.jar file on your classpath, and then you can use the classes in the javax.mail package to send the e-mail.



class variable

Also known as a static variable, a class variable is defined at the class level, using the static modifier, and does not rely on any particular instance of the class to be invoked.



comment

Text that explains to yourself or other programmers what the purpose of this code is, what other code it affects, and other metadata such as the author's name and the created date. Single-line comments begin with // . Multi-line comments begin with /* and end with */ . Javadoc comments, which the javadoc program uses to generate HTML documentation, use /** .



compile-time

The time at which a source file is compiled into a class file. Some errors are caught during compile-time.



compiler

The program distributed with J2SE called javac, which translates Java source code (in .java files) into Runnable bytecode (.class files).



constructor

A constructor is defined in a class file, and is used to create instances of the class. Constructors have the same name as their class, and are invoked using the new keyword. A Java class may define zero or more constructors. If no constructor is defined, the constructor for the superclass is automatically invoked. Additional constructors must specify a unique argument list, just like overloaded methods.



continue

A Java keyword used inside loops . Invoking it causes program execution to resume at the end of the current loop. As with break , if a label is used, execution resumes at the label.





Java Garage
Java Garage
ISBN: 0321246233
EAN: 2147483647
Year: 2006
Pages: 228
Authors: Eben Hewitt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net