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

Beschreibung

Quiz am Primer Set de Preguntas Java OCA Exam (1z0-803), erstellt von webmasterMyJavaZone am 14/06/2014.
webmasterMyJavaZone
Quiz von webmasterMyJavaZone, aktualisiert more than 1 year ago
webmasterMyJavaZone
Erstellt von webmasterMyJavaZone vor etwa 10 Jahre
32375
2

Zusammenfassung der Ressource

Frage 1

Frage
Which statement is not true about package statements?
Antworten
  • 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.

Frage 2

Frage
Which statement represents a valid statement that will allow for the inclusion of classes from the java.util package?
Antworten
  • import java.util;
  • import java.util.*;
  • #include java.util;
  • #include java.util.*;

Frage 3

Frage
List four interfaces of the Collections API.
Antworten
  • ArrayList, Map, Set, Queue
  • List, Map, Set, Queue
  • List, Map, HashSet, PriorityQueue
  • List, HashMap, HashSet, PriorityQueue

Frage 4

Frage
Which class in the java.io package allows for the reading and writing of files to specified locations within a file?
Antworten
  • File
  • FileDescriptor
  • FilenameFilter
  • RandomAccessFile

Frage 5

Frage
Which MS Windows–based command-line utility will allow you to run the Java interpreter without launching the console window?
Antworten
  • javaw
  • interpw
  • java -wo
  • jconsole

Frage 6

Frage
What is the correct import package needed to use the ArrayList class?
Antworten
  • 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.

Frage 7

Frage
Of the following packages, which contain classes for building a graphical interface? (Choose all that apply.)
Antworten
  • java.awt
  • java.io
  • java.net
  • javax.swing
  • java.util

Frage 8

Frage
Which of the following statements is correct?
Antworten
  • 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.

Frage 9

Frage
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?
Antworten
  • your company name
  • com.your company name
  • java.your company name
  • java.your_company_name
  • com.your_company_name

Frage 10

Frage
What is the result of running the following command: javac Simulator.java
Antworten
  • 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.

Frage 11

Frage
Of the following, which types of statements must be used to count the number of nickels in a String array of various coins?
Antworten
  • Assignment
  • Assertion
  • Iteration
  • Conditional

Frage 12

Frage
The following short code segment contains two errors. What are they? int a = 1; does a = 2; while (a == 1)
Antworten
  • 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.

Frage 13

Frage
The continue and break statements are allowed within what types of statements?
Antworten
  • Loop statements
  • All conditional statements
  • The switch statement
  • Expression statements

Frage 14

Frage
Select the commenting style that uses symbols designed to work with Javadoc.
Antworten
  • // @author Robert
  • /* @author Robert */
  • /** @author Robert */
  • /** @author Robert ;

Frage 15

Frage
Given the following code segments, which answer is NOT a valid Javaimplementation because it won’t compile?
Antworten
  • 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;
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Juraexamen Karteikarten - Strafrecht
anna.grillborzer0656
Berliner Mauer - Quiz
Laura Overhoff
Kapitel 1: Was macht Psychologie einzigartig?
bence-bartos
Wortschatz Französisch 3. Gesundheit und Medizin
l_u_n_a_19
GPSY ALPS
Malte Ni
WERB Uni Wien 2017/18
Denise Schmid
OEKO UniVie (korrigiert)
Laus Kojka
Forstpolitik Krott
Ulf Grätz
Onlinequiz zu MS-4.2 Kapitel_2_Teil_II
Deborah Büscher
Vetie Innere Medizin 2020
Ferdinand Kähn
Vetie - Milchkunde 2016
Birte Schulz