Sunday, November 30, 2008
Label is the name of a label that identifies a block of code. When this form of break executes, control is transferred out of the named block of code. The labeled dbl.ock of code must enclose the break statement, but it does not need to be immediately enclosing block. This means that you can use a labeled break statement to exit from a set of nested blocks. But the break cannot be used to transfer control to a block of code that does not enclose the break statement. A label is any valid Java identifier followed by a colon. Once a block is labeled, then it can be used as the target of a break statement.
Friday, November 28, 2008
Thursday, November 27, 2008
An array is a group of like-typed variables that are referred by a common name. Arrays of any type can be created and may have one or more dimensions. A specific element in an array is accessed by its index. Arrays offer a convenient means of grouping related information. A one dimensional array is essentially a list of like-typed variables. To create an array, one must first create an array variable of the desired type.
Wednesday, November 26, 2008
Java defines several type promotion rules that apply to expressions in addition to the elevation of bytes and shorts to int. First, all byte and short values are promoted to int. Then if one operand is a long, the whole expression is promoted to long. If one operand is float, the entire expression is promoted to float. If any of the operands is double, the result is double. The outcome of float plus an int is a float. Then the resultant float minus the last double is promoted to double, which is the type for the final result of the expression.
Tuesday, November 25, 2008
Double precision as denoted keyword, uses 64 bits to store a value. Double precision is actually faster than single precision on some modern processors that have been optimized for high speed mathematical calculations. All transcendental math functions, such as sin (), cos (), return double values. When accuracy has to be maintained over many iterative calculations, or manipulating large-valued numbers double is the best choice.