# | Question |
1 | Which identifiers are legal? (Choose all that apply) A. 1Hello |
2 | Which identifiers are legal? (Choose all that apply) A. $Hello |
3 | Which identifiers are legal? (Choose all that apply) A. 1_Hello |
4 | Choose the true statements about
the following code. (Choose all that apply) System.out.println("Hello "World" Class"); |
5 | Choose the true statements about
the following code. (Choose all that apply) String strMsg = "My nick name is \"Mike\"\nfor
Michael"; |
6 | Choose the true statements about
the following code. (Choose all that apply) String strMsg = "Say, \"I Love You\"\nToo"; |
7 | Choose all the code samples that
will compile. (Choose all that apply) A. Boolean blnMy = true; |
8 | Choose all the code samples that
will compile. (Choose all that apply) A. int intMy = 10L; |
9 | Choose all the code samples that
will compile. (Choose all that apply) A. double dblMy = 10.0; |
10 | Choose all the code samples that
will compile. (Choose all that apply) A. char charMy = "A"; |
11 | Choose all the code samples that
will compile. Assume the following code exits. (Choose all that apply) byte byteMy = (byte) 10; A. byte byteTest = byteMy; |
12 | An identifier is a series of characters consisting of letters,
digits, underscores(_) and dollar signs ($) that does not begin with
a digit, does not contain any spaces and is not a keyword.
True |
13 | When working with Primitive
Data, you can assign a lower precision to a higher precision because
Java will implicitly cast.
True |
14 | You must explicitly cast when
assigning Primitive Data with a higher precision to a lower precision.
True |
15 | Choose which statements are true.
Assume the following code exits. (Choose all that apply) short shtMy = (short) 10; int intMy = 10; double dblMy = 10.0D; float fltMy = 10.0F; A. intMy = shtMy; |
16 | Choose which statements are
true. (Choose all that apply) A. There are 4 integer data types: byte, short, int, long. |
17 | Choose which statements are
valid method identifiers. (Choose all that apply) A. private void 2MyMethod () {} |
18 | Choose which statements are
valid class identifiers. (Choose all that apply) A. class _MyClass{} |
19 | Choose which statements will
compile with JDK 1.2 and above. (Choose all that apply) A. int intMy = Integer.parseInt("10"); |
20 | Choose which statements will
compile with JDK 1.2 and above. (Choose all that apply) A. double dblMy = Double.parseDouble( 10.0 ); |