Ajude a dar forma ao GoConqr. O que a gente deve adicionar?

Quiz

Java Practice 3

Ummm No 105 perguntas

Fazer o quiz

Perguntas do quiz (105)

  1. 1Which class do you use to write data into a text file?
    1. ASystem
    2. BPrintWriter
    3. CScanner
    4. DFile
  2. 2Which of the following statements is false?
    1. AThe smallest data item a computer can assume is the value 0 or the value 1.
    2. BThe term "bit" is short for "byte digit."
    3. CJava uses the Unicode character set.
    4. DA record is typically composed of several fields.
  3. 3What is the return value of "SELECT".substring(0, 5)?
    1. A"SELECT"
    2. B"SELE"
    3. C"SELEC"
    4. D"ELECT"
  4. 4Which of the following assignment statements is incorrect? (Choose all that apply.)
    1. Ai == j == k == 1;
    2. Bi = j = k = 1;
    3. Ci = 1; j = 1; k = 1;
    4. Di = 1 = j = 1 = k = 1;
  5. 5An argument type followed by a(n) __________________ in a method's parameter list indicates that the method receives a variable number of arguments of that particular type.
    1. Asquare brackets ([]).
    2. Bellipsis ().
    3. Cvarargs keyword.
    4. DAll of the above are acceptable to indicate a variable number of arguments.
  6. 6Which of the following statements creates a multidimensional array with 3 rows, where the first row contains 1 element, the second row contains 4 elements and the final row contains 2 elements?
    1. Aint[][] items = { { 1, null, null, null }, { 2, 3, 4, 5 }, { 6, 7, null, null } };.
    2. Bint[][] items = { { 1 }, { 2, 3, 4, 5 }, { 6, 7 } };.
    3. Cint[][] items = { { 1 }, { 2, 3, 4, 5 }, { 6, 7 }, {} );.
    4. Dint[][] items = { { 1 }, { 4 }, { 2 } };.
  7. 7What modifier should you use on the members of a class so that they are not accessible to another class in a different package, but are accessible to any subclasses in any package?
    1. Aprotected
    2. Bpublic
    3. Cprivate
    4. DUse the default modifier.
  8. 8Which of the following statements are true about an immutable object? (Choose all that apply.)
    1. AThe contents of an immutable object cannot be modified.
    2. BAn immutable object contains no mutator methods.
    3. CAll properties of an immutable object must be of primitive types.
    4. DAll properties of an immutable object must be private.
    5. EAn object type property in an immutable object must also be immutable.
  9. 9What is the output of the following code?
    public class Test {
    public static void main(String[ ] args) {
    String s1 = new String("Welcome to Java");
    String s2 = s1;

    s1 += "and Welcome to HTML";

    if (s1 == s2)
    System.out.println("s1 and s2 reference to the same String object");
    else
    System.out.println("s1 and s2 reference to different String objects");
    }
    }
    1. As1 and s2 reference to different String objects
    2. Bs1 and s2 reference to the same String object
  10. 10Which of the following is not an algorithm?
    1. AA recipe.
    2. BOperating instructions.
    3. CTextbook index.
    4. DShampoo instructions (lather, rinse, repeat).

Informações

Descrição
A practice test for Java level 1 at Gwinnett Technical College
Autor
Ummm No
Idioma
English
Visualizações
321
Etiquetas
javapracticetext
Avaliação
Ainda sem avaliações
Avalie este quiz
Avalie este quiz

Fale Conosco

Sobre o que é sua mensagem?

O que a gente deve adicionar?