Preview

The Papaer Java Test Questions and Answers

Good Essays
Open Document
Open Document
1518 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
The Papaer Java Test Questions and Answers
Gaddis – Starting Out With Java 5 – From Control Structures to Objects
Chapter 06 – A First Look At Classes

Multiple Choice

1. One or more objects may be created from a(n)_____.
a. field
b. class
c. method
d. instance

ANS: B

2. Class objects normally have _____ that perform useful operations on their data, but primitive variables do not.
a. fields
b. instances
c. methods
d. relationships

ANS: C

3. In the cookie cutter method: Think of the _____ as a cookie cutter and _____ as the cookies.
a. object; classes
b. class; objects
c. class; fields
d. field; methods

ANS: B

4. A UML diagram does not contain _____.
a. class name
b. methods
c. fields
d. object names

ANS: D

5. An access specifier indicates how the class may be accessed.
a. True
b. False

ANS: A

6. Data hiding, which means that critical data stored inside the object is protected from code outside the object is accomplished in Java by _____.
a. using the public access specifier on the class methods
b. using the private access specifier on the class methods
c. using the private access specifier on the class definition
d. using the private access specifier on the class fields

ANS: D

7. For the following code, which statement is not true? public class Sphere
{
private double radius; public double x; private double y; private double z;
}
a. x is available to code that is written outside the Sphere class.
b. radius is not available to code written outside the Sphere class.
c. radius, x, y, and z are called members of the Sphere class.
d. z is available to code that is written outside the Sphere class.

ANS: D

8. Which of the following is not part of the method header?
a. Method name
b. Return type
c. Access specifier
d. Parameter variable declaration
e. All of the above are parts of the method header

ANS: E

9. A method that stores a value in a class’s field or in some other way changes the value of a field is known as a

You May Also Find These Documents Helpful

  • Satisfactory Essays

    The data access object (DAO) software program design pattern encapsulates use of data by concealing its difficulty from end users (University of Phoenix, 2005). This design pattern is a concept offering an abstract interface to a database or perseverance method, which it only provides a few specified functions excluding the visibility of the database particulars. The DAO includes a mapping from the software calls to its perseverance layer that isolates the general public interface of the DAO.…

    • 579 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Fall2011 Test2

    • 1408 Words
    • 6 Pages

    Multiple Choice (1.5 marks each – put the letter of the best answer in the box above)…

    • 1408 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    PA130 Unit 2 Test Answers

    • 358 Words
    • 7 Pages

    Grading Summary These are the automatically computed results of your exam. Grades for essay questions, and comments from your instructor, are in the "Details" section below. Question Type: Date and Time Started: Time Spent: Points Received: # Of Questions: 9/3/2014 9:06:38 PM 05 min , 25 secs 20 / 20 (100%) # Correct: True/False 7 7 Multiple Choice 3 3…

    • 358 Words
    • 7 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1310 Unit 7

    • 2452 Words
    • 10 Pages

    Encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class. A procedure is a type of encapsulation because it combines a series of computer instructions. Likewise, a complex data type, such as a record or class, relies on encapsulation.…

    • 2452 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    Psy300 Week 8

    • 760 Words
    • 4 Pages

    • Identify how you can encapsulate the data and processes you identified into an object-oriented design.…

    • 760 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Java Chapter 2 Quiz

    • 2047 Words
    • 9 Pages

    4. The ____ is normally considered the standard output and standard input devices, and usually refer to…

    • 2047 Words
    • 9 Pages
    Powerful Essays
  • Powerful Essays

    Java exam 1 practice test

    • 6434 Words
    • 53 Pages

    A set of instructions that enable the computer to solve a problem or perform a task…

    • 6434 Words
    • 53 Pages
    Powerful Essays
  • Satisfactory Essays

    test questions

    • 404 Words
    • 2 Pages

    6. What is a hot spot (geologically speaking), what do they form in ocean basins, and what do they indicate…

    • 404 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    5) In class one day, your teacher shows you an apple and asks you to think about and record your feelings and perceptions of it. What method is your teacher using?…

    • 1126 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Phisycal evidence

    • 335 Words
    • 1 Page

    3. The difference is that class characteristics can only be in group and not in a single source.…

    • 335 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Ansel Adams was a black and white photographer and also an environmentalist. He was born in San Francisco California. Adams grew up in a house by the sand dunes of the Golden Gate. Adams was already a really shy and intense genius personality. He learned how to do painting and photos at an early age, he taught himself most of his skills because his parents were old when he was young so he didn’t have many people to teach him, he took it into his own hands.…

    • 446 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    If you add a table to a slide that already has a theme applied to it, the table will appear in a style that complements the theme.…

    • 446 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Chapter 3

    • 471 Words
    • 2 Pages

    4. With respect to the general classes of computers, a _________ is the most expensive and most powerful kind of computer, which is used primarily to assist in solving massive scientific problems…

    • 471 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    APHG Unit Test Answers

    • 1172 Words
    • 5 Pages

    The current population pyramid of the United States has a noticeable bulge in the middle, which is due primarily to:…

    • 1172 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Fluids

    • 2539 Words
    • 11 Pages

    1. Identify each of the following statements as either true or false. If false, explain why.…

    • 2539 Words
    • 11 Pages
    Good Essays