I

     
identifier

A name used to represent a data item in a Java program such as a field, method, or class.



implements

A Java keyword used in the class declaration to indicate the name of an interface that this class provides an implementation for. A class can implement multiple interfaces; when this is done, separate interface names with a comma, as in this example: public final class String extends Object implements CharSequence, Comparable, Serializable .



import

Allows the programmer to reference individual class names in code without using the fully qualified class name (that is, without using the package name). Only classes in the java.lang package are imported automatically ”and because of this, we can simply type String in our code, instead of java.lang.String . Note that as of Java 1.5, you can perform static imports, which means that you can import the static methods and fields of a class so that you don't have to prefix the class name when you invoke them.



Inheritance

In object-oriented programming, the concept that a class automatically receives data and functionality ( variables and methods) from its parent class. In Java, all classes inherit from java.lang.Object. The parent class is also referred to as the superclass, in which case, the inheriting class is referred to as the subclass.



Instance

One particular object of a class ”that is, the object referred to by this. To create an instance of an object, use the new keyword. For example, this code creates a new instance of the Integer class: Integer x = new Integer(42); .



instanceof

A Java keyword indicating the operator that determines if a reference is of a certain type. The operation returns true if the reference passed can legally be cast to the given type. For example, the statement return "Hey!" instanceof Object; will return true, because String extends Object. Note that it also works when the reference type is an interface: return (new ArrayList() instanceof Collection) also returns true.



int

A Java keyword used to declare a 32-bit signed integer primitive in the range of 231 to 231-1 (or -2,147,483,648 to 2,147,483,647).



interface

A Java keyword used to define a set of methods and constants without implementation. A class that implements the interface must provide an implementation for each method defined in the interface. An interface can be used as the reference type for a class that implements the interface. For example, ArrayList implements the methods of the Collection interface, so we can legally write this: Collection myArrayList = new ArrayList(); . We can then use our myArrayList object anywhere that a Collection is called for.



Iterator

An interface that offers a way to allow a caller to access each element in a collection without exposing the collection itself to the caller. The benefit is one of increased encapsulation. Iterator is an improvement over the older Enumeration, in that they feature clearer, more precise method names, and offer a way to remove elements from the collection.





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