Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. [] Which of the following types does the Java programming language support? S

ID: 3561434 • Letter: 1

Question

 1. []  Which of the following types does the Java programming language support?    Select all that apply.     a. integer    b. Integer    c. Object    d. object  2. [] What is the range of values that a short can represent?     a. 0 to 256    b. -127 to 128    c. Math.pow(-2.0,15.0) to (Math.pow(2.0,15.0) -1)    d. 0 to Math.pow(2.0,16.0)  3. [] Which of the following is legal syntax for declaring arrays? Select all that apply.     a. int[] x = { 5 };    b  int y[];    c. String s[] = "bread", "milk", "chocolate";    d. Object[] theList;    e. Object anotherList[][];  4. []  Which of the following initializer lists would correctly set the elements of array n?     a. int[] n = { 1, 2, 3, 4, 5 };.     b. array n[ int ] = { 1, 2, 3, 4, 5 };.     c. int n[ 5 ] = { 1; 2; 3; 4; 5 };.     d. int n = new int( 1, 2, 3, 4, 5 );.    5. [] Examine the following variable declarations:      String s = "";     float f = 0f;     int i = 0;      Using the above declarations,     which of the following statements are valid? Select all that apply.      a. s += f;     b. f += s;     c. i += f;     d. i = f;     e. f = i; 

Explanation / Answer

1)

2)

3)

4)

5)