|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|
|
Java keywords and
identifiers
|
|
Keywords are reserved words
that are predefined in the language; see the table below. All the keywords are
in lowercase.
|
abstract
|
boolean
|
break
|
byte
|
case
|
catch
|
|
char
|
class
|
const
|
continue
|
default
|
do
|
|
double
|
else
|
extends
|
final
|
finally
|
float
|
|
for
|
goto
|
if
|
implements
|
import
|
instanceof
|
|
int
|
interface
|
long
|
native
|
new
|
package
|
|
private
|
protected
|
public
|
return
|
short
|
static
|
|
strictfp
|
super
|
switch
|
synchronized
|
this
|
throw
|
|
throws
|
transient
|
try
|
void
|
volatile
|
while
|
Note:
assert is a new keyword since J2SE
1.4
An identifier is composed of a
sequence of characters where each character can be a letter, a digit, an
underscore, or a dollar sign.
An identifier declared by the
programmer cannot be a Java keyword and it cannot start with a digit. For
instance:
number, $$abc, _xyx // Legal Identifiers
12cc, ss-he // Illegal identifiers
Ranges of primitive
types
The size and range of all primitive types are listed in the table below. The
positive range is one less than the negative range because zero is stored as a
positive number. For the boolean datatype, there is no range; it can only be
true or false.
|
Primitive Type
|
Size
|
Range of Values
|
|
byte
|
8 bits
|
-27 to
27-1
|
|
short
|
16 bits
|
-215 to
215-1
|
|
int
|
32 bits
|
-231 to
231-1
|
|
long
|
64 bits
|
-263 to
263-1
|
|
char
|
16 bits
|
0 to 216-1
|
|
float
|
32 bits
|
|
|
double
|
64 bits
|
|
|
|
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
|
|