webmasterMyJavaZone
Test por , creado hace más de 1 año

Test sobre Primer Set de Preguntas Java OCA Exam (1z0-803), creado por webmasterMyJavaZone el 14/06/2014.

32376
2
0
Sin etiquetas
webmasterMyJavaZone
Creado por webmasterMyJavaZone hace alrededor de 10 años
Cerrar

Primer Set de Preguntas Java OCA Exam (1z0-803)

Pregunta 1 de 15

1

Which statement is not true about package statements?

Selecciona una de las siguientes respuestas posibles:

  • Package statements are optional.

  • Package statements are limited to one per source file.

  • Standard Java coding convention for package names reverses the domain name of the organization or group creating the package.

  • The package names beginning with javas.* and javaw.* are reserved.

Explicación

Pregunta 2 de 15

1

Which statement represents a valid statement that will allow for the inclusion of classes from the java.util package?

Selecciona una de las siguientes respuestas posibles:

  • import java.util;

  • import java.util.*;

  • #include java.util;

  • #include java.util.*;

Explicación

Pregunta 3 de 15

1

List four interfaces of the Collections API.

Selecciona una de las siguientes respuestas posibles:

  • ArrayList, Map, Set, Queue

  • List, Map, Set, Queue

  • List, Map, HashSet, PriorityQueue

  • List, HashMap, HashSet, PriorityQueue

Explicación

Pregunta 4 de 15

1

Which class in the java.io package allows for the reading and writing of files to specified locations within a file?

Selecciona una de las siguientes respuestas posibles:

  • File

  • FileDescriptor

  • FilenameFilter

  • RandomAccessFile

Explicación

Pregunta 5 de 15

1

Which MS Windows–based command-line utility will allow you to run the Java interpreter without launching the console window?

Selecciona una de las siguientes respuestas posibles:

  • javaw

  • interpw

  • java -wo

  • jconsole

Explicación

Pregunta 6 de 15

1

What is the correct import package needed to use the ArrayList class?

Selecciona una de las siguientes respuestas posibles:

  • import java.awt.*;

  • import java.io.*;

  • import java.net.*;

  • import javax.swing.*;

  • import java.util.*;

  • This is a trick question, because it is part of the java.lang package that is imported automatically.

Explicación

Pregunta 7 de 15

1

Of the following packages, which contain classes for building a graphical interface? (Choose all that apply.)

Selecciona una o más de las siguientes respuestas posibles:

  • java.awt

  • java.io

  • java.net

  • javax.swing

  • java.util

Explicación

Pregunta 8 de 15

1

Which of the following statements is correct?

Selecciona una de las siguientes respuestas posibles:

  • A Java class can extend only one superclass.

  • A Java class can extend multiple superclasses.

  • A Java class cannot extend any superclasses.

  • A Java class does not extend superclasses; it implements them.

Explicación

Pregunta 9 de 15

1

You have created a set of classes for your company and would like to include them in a package. Which one of the following would be a valid package name?

Selecciona una de las siguientes respuestas posibles:

  • your company name

  • com.your company name

  • java.your company name

  • java.your_company_name

  • com.your_company_name

Explicación

Pregunta 10 de 15

1

What is the result of running the following command:

javac Simulator.java

Selecciona una de las siguientes respuestas posibles:

  • The simulator program would be executed.

  • A bytecode file Simulator.class would be created.

  • A bytecode file Simulator.java would be created.

  • An error would be displayed because this is the wrong syntax.

Explicación

Pregunta 11 de 15

1

Of the following, which types of statements must be used to count the number of nickels in a String array of various coins?

Selecciona una o más de las siguientes respuestas posibles:

  • Assignment

  • Assertion

  • Iteration

  • Conditional

Explicación

Pregunta 12 de 15

1

The following short code segment contains two errors. What are they?
int a = 1;
does
a = 2;
while (a == 1)

Selecciona una o más de las siguientes respuestas posibles:

  • The declaration for the variable a must occur within the dowhile statement.

  • Braces must be included for do-while statements even when only one statement is enclosed.

  • There is no does keyword; only the do keyword is allowed as part of a conditional statement.

  • The do-while statement must end with a semicolon.

Explicación

Pregunta 13 de 15

1

The continue and break statements are allowed within what types of statements?

Selecciona una o más de las siguientes respuestas posibles:

  • Loop statements

  • All conditional statements

  • The switch statement

  • Expression statements

Explicación

Pregunta 14 de 15

1

Select the commenting style that uses symbols designed to work with Javadoc.

Selecciona una de las siguientes respuestas posibles:

  • // @author Robert

  • /* @author Robert */

  • /** @author Robert */

  • /** @author Robert ;

Explicación

Pregunta 15 de 15

1

Given the following code segments, which answer is NOT a valid Javaimplementation because it won’t compile?

Selecciona una de las siguientes respuestas posibles:

  • int variableA = 10;
    float variableB = 10.5f;
    int variableC = variableA + variableB;

  • int variableA = 10;
    float variableB = 10.5f;
    float variableC = variableA + variableB;

  • byte variableA = 10;
    float variableB = 10.5f;
    float variableC = variableA + variableB;

  • byte variableA = 10;
    double variableB = 10.5f;
    double variableC = variableA + variableB;

Explicación