More java quizzes

Anonymous
timer Asked: Jan 4th, 2018
account_balance_wallet $10

Question description

6.

Which three are legal array declarations?

  1. int [] myScores [];
  2. char [] myChars;
  3. int [6] myScores;
  4. Dog myDogs [];
  5. Dog myDogs [7];
A.1, 2, 4
B.2, 4, 5
C.2, 3, 4
D.All are correct.


7.
public interface Foo 
{ 
    int k = 4; /* Line 3 */
}
Which three piece of codes are equivalent to line 3?
  1. final int k = 4;
  2. public int k = 4;
  3. static int k = 4;
  4. abstract int k = 4;
  5. volatile int k = 4;
  6. protected int k = 4;


8.

Which one of the following will declare an array and initialize it with five numbers?

A.Array a = new Array(5);
B.int [] a = {23,22,21,20,19};
C.int a [] = new int[5];
D.int [5] array;


9.

Which three are valid declarations of a char?

  1. char c1 = 064770;
  2. char c2 = 'face';
  3. char c3 = 0xbeef;
  4. char c4 = \u0022;
  5. char c5 = '\iface';
  6. char c6 = '\uface';


10.

Which is the valid declarations within an interface definition?

A.public double methoda();
B.public final double methoda();
C.static void methoda(double d1);
D.protected void methoda(double d1);

Tutor Answer

Td-jakes
School: Carnegie Mellon University

here is the work....

Which three are legal array declarations?
1.
2.
3.
4.
5.

int [] myScores [];
char [] myChars;
int [6] myScores;
Dog myDogs [];
Dog myDogs [7];

A.1, 2, 4
B. 2, 4, 5
C.2, 3, 4
D.All are ...

flag Report DMCA
Review

Anonymous
Excellent job

Similar Questions
Hot Questions
Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors