Start FlashCards Download PDF

Get the best College algebra course in your pocket!

Exam PDF eBook: 
My OCA Mock
Download My OCA Exam PDF eBook
90 Pages
2015
English US
Educational Materials



Sample Questions from the My OCA Mock Exam

Question: Which of the following statements is correct?

Choices:

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.

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

Choices:

Assignment

Assertion

Iteration

Conditional

Question: List four interfaces of the Collections API.

Choices:

ArrayList, Map, Set, Queue

List, Map, Set, Queue

List, Map, HashSet, PriorityQueue

List, HashMap, HashSet, PriorityQueue

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

Choices:

import java.awt.*;

import java.io.*;

import java.net.*;

import javax.swing.*;

import java.util.*;

Question: Which statement is not true about package statements?

Choices:

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.

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

Choices:

import java.util;

import java.util.*;

#include java.util;

#include java.util.*;

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

Choices:

java.awt

java.io

java.net

javax.swing

java.util

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

Choices:

javaw

interpw

java -wo

jconsole

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

Choices:

File

FileDescriptor

FilenameFilter

RandomAccessFile

Question: What is the result of running the following command: javac Simulator.java

Choices:

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.

Question: 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?

Choices:

your company name

com.your company name

java.your company name

java.your_company_name

com.your_company_name

Start FlashCards Download PDF
Eric Crawford
Start Quiz
Subramanian Divya
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.quizover.com/embed/my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>