Java Software Solutions 8th Edition Lewis Test
Bank download
https://testbankfan.com/product/java-software-solutions-8th-
edition-lewis-test-bank/
Visit testbankfan.com today to download the complete set of
test bank or solution manual
We believe these products will be a great fit for you. Click
the link to download now, or visit testbankfan.com
to discover even more!
Java Software Solutions 8th Edition Lewis Solutions Manual
https://testbankfan.com/product/java-software-solutions-8th-edition-
lewis-solutions-manual/
Java Software Solutions 9th Edition Lewis Test Bank
https://testbankfan.com/product/java-software-solutions-9th-edition-
lewis-test-bank/
Java Software Solutions 9th Edition Lewis Solutions Manual
https://testbankfan.com/product/java-software-solutions-9th-edition-
lewis-solutions-manual/
Essentials of Psychiatric Mental Health Nursing 1st
Edition Varcarolis Test Bank
https://testbankfan.com/product/essentials-of-psychiatric-mental-
health-nursing-1st-edition-varcarolis-test-bank/
Discrete Mathematics with Applications 4th Edition Susanna
Solutions Manual
https://testbankfan.com/product/discrete-mathematics-with-
applications-4th-edition-susanna-solutions-manual/
Law for Business 11th Edition Barnes Test Bank
https://testbankfan.com/product/law-for-business-11th-edition-barnes-
test-bank/
Understanding Cross Cultural Management 2nd Edition
Browaeys Solutions Manual
https://testbankfan.com/product/understanding-cross-cultural-
management-2nd-edition-browaeys-solutions-manual/
Organizational Behavior A Critical Thinking Approach 1st
Edition Neck Solutions Manual
https://testbankfan.com/product/organizational-behavior-a-critical-
thinking-approach-1st-edition-neck-solutions-manual/
Principles of Leadership International 7th Edition DuBrin
Test Bank
https://testbankfan.com/product/principles-of-leadership-
international-edition-7th-edition-dubrin-test-bank/
Sociology in Our Times 9th Edition Diana Test Bank
https://testbankfan.com/product/sociology-in-our-times-9th-edition-
diana-test-bank/
1
Copyright © 2015 Pearson Education, Inc.
Java Software Solutions, 8e (Lewis/Loftus)
Chapter 7 Object-Oriented Design
7.1 Multiple-Choice Questions
1) During program development, software requirements specify
A) how the program will accomplish the task
B) what the task is that the program must perform
C) how to divide the task into subtasks
D) how to test the program when it is done
E) all of the above
Answer: B
Explanation: B) The specification phase is to understand the problem at hand so that the
programmer can determine what needs to be done to solve the problem. The other efforts listed
above are part of the design phase (A, C) and testing phase (D).
2) Once we have implemented the solution, we are not done with the problem because
A) the solution may not be the best (most efficient)
B) the solution may have errors and need testing and fixing before we are done
C) the solution may, at a later date, need revising to handle new specifications
D) the solution may, at a later date, need revising because of new programming language
features
E) all of the above
Answer: E
Explanation: E) A program should not be considered as a finished product until we are
reasonably assured that it is efficient and error-free. Further, it is common that programs require
modification in the future because of a change to specifications or a change to the language or
computer running the program.
3) Of the various phases in software development, which of the following is usually the
lengthiest?
A) specification
B) design
C) implementation
D) testing
E) maintenance
Answer: E
Explanation: E) The maintenance phase exists for as long as the software is in use. Software
requires modification (such as new requirements such as new features or I/O specifications) and
so the maintenance phase is on-going whereas the other phases end once the software has been
released and is in use.
2
Copyright © 2015 Pearson Education, Inc.
4) A bad programming habit is to build an initial program and then spend a great deal of time
modifying the code until it is acceptable. This is known as
A) the prototyping approach
B) the waterfall model
C) iterative development
D) the recursive approach
E) the build-and-fix approach
Answer: E
Explanation: E) Programmers who do not think things through will often build a program that
does not fit the original requirements. They then spend an inordinate amount of time trying to
repair the program to more properly fit. This is known as "build-and-fix" and is a poor
programming practice.
5) The activities of the development cycle are generally thought to
A) be strictly linear
B) be rigidly ordered
C) overlap
D) have optional steps
E) both A and B are true
Answer: C
Explanation: C) A flaw of the waterfall model is that it does not permit repetition or
backtracking through the development cycle. However, phases often need revisiting resulting in
a development cycle where the development activities overlap.
6) The idea of having programmers and developers meet in order to critique a software design or
implementation is known as
A) an interview
B) a walkthrough
C) prototyping
D) aggregation
E) evolutionary development
Answer: B
Explanation: B) Such meetings are very useful so that the various members can analyze the
solution to that point in time and offer suggestions to enhance the design and implementation.
This is called a walkthrough because it involves going step-by-step through the proposed or
implemented design.
3
Copyright © 2015 Pearson Education, Inc.
7) Modifying a program in order to eliminate deficiencies is done in the ________ phase of the
development cycle.
A) design
B) implementation
C) testing
D) use
E) maintenance
Answer: E
Explanation: E) While testing is used to find errors, deficiencies are more commonly identified
by the users of the system once the system has been released. After such deficiencies have been
identified, it is up to the software maintenance group to eliminate them in future versions of the
software.
8) It is easier to correct errors found in a program if
A) they are identified early in the development cycle
B) they are identified during testing
C) they are identified during program use
D) they are identified during maintenance
E) all of the above are equally true, errors are easily corrected in any of these stages
Answer: A
Explanation: A) Errors introduced early in the development cycle often cause tremendous
problems if not caught early on. Therefore, errors found in testing, use or maintenance phases
may be too embedded in the systems' design to be easily corrected. But if found early on, the
errors can be completely eliminated.
9) In general, spending more time in development to ensure better software will
A) shorten testing time
B) slightly reduce maintenance efforts
C) slightly increase maintenance efforts
D) greatly reduce maintenance efforts
E) not alter the time it takes for any other stage whatsoever
Answer: D
Explanation: D) Spending more time in development promises better software, which in turn
leads to less maintenance effort.
4
Copyright © 2015 Pearson Education, Inc.
10) The idea that an object can exist separate from the executing program that creates it is called
A) transience
B) static
C) persistence
D) serialization
E) finality
Answer: C
Explanation: C) Objects are stored in memory and are reclaimed by the garbage collector when
they are no longer referenced. When a Java program terminates, no object is referenced and so
all objects are reclaimed. It is desirable, however, to be able to save any given object for future
use. This trait is called persistence, and the ability to do this is by saving the instance data of the
object to a file. This can be done by writing each instance data to a data file, but is simplified
using Object Serialization.
11) In order to create a constant, you would use which of the following Java reserved words?
A) private
B) static
C) int
D) final
E) class
Answer: D
Explanation: D) The reserved word final indicates that this is the final value that will be stored
in this variable, thus making it unchangeable, or constant. While constants can be of type int,
constants can be of any other type as well. It is the final reserved word that makes the value
unchangeable.
12) Which of the following methods is a static method? The class in which the method is
defined is given in parentheses following the method name.
A) equals (String)
B) toUpperCase (String)
C) sqrt (Math)
D) format (DecimalFormat)
E) paint (Applet)
Answer: C
Explanation: C) The Math class defines all of its methods to be static. Invoking Math methods
is done by using Math rather than a variable of type Math. The other methods above are not
static.
5
Copyright © 2015 Pearson Education, Inc.
13) Static methods cannot
A) reference instance data
B) reference non-static instance data
C) reference other objects
D) invoke other static methods
E) invoke non-static methods
Answer: B
Explanation: B) A static method is a method that is part of the class itself, not an instantiated
object, and therefore the static method is shared among all instantiated objects of the class. Since
the static method is shared, it cannot access non-static instance data because all non-static
instance data are specific to instantiated objects. A static method can access static instance data
because, like the method, the instance data is shared among all objects of the class. A static
method can also access parameters passed to it.
14) An object that refers to part of itself within its own methods can use which of the following
reserved words to denote this relationship?
A) inner
B) i
C) private
D) this
E) static
Answer: D
Explanation: D) The reserved word this is used so that an object can refer to itself. For instance,
if an object has an instance data x, then this.x refers to the object's value x. While this is not
necessary, it can be useful if a local variable or parameter is named the same as an instance data.
The reserved word this is also used to refer to the class as a whole, for instance, if the class is
going to implement an interface class rather than import an implementation of an interface class.
15) An example of an aggregation relationship is
A) parent and child
B) animal and dog
C) teacher and computer
D) phone and fax machine
E) all of the above
Answer: C
Explanation: C) An aggregate relationship describes how one object accomplishes a task by
using another object. In the above list, the teacher uses the computer. The relationship in A is
one of lineage (possibly ownership), in B is an is-a relationship as a dog is a child class of
animal, and in D is one of similarity, phone and fax machine might be thought of as sibling
classes, related to each other in that they are both children of a more general communication
class.
6
Copyright © 2015 Pearson Education, Inc.
16) Inheritance through an extended (derived) class supports which of the following concepts?
A) interfaces
B) modulary
C) information hiding
D) code reuse
E) correctness
Answer: D
Explanation: D) By extending a class and inheriting from it, the new class does not have to
reimplement any of those inherited methods or instance data, thus saving the programmer an
effort. So, code reuse is the ability to reuse someone else's code for your benefit by extending it
for your need.
17) Java does not support multiple inheritance, but some of the abilities of multiple inheritance
are available by
A) importing classes
B) implementing interfaces
C) overriding parent class methods
D) creating aliases
E) using public rather than protected or private modifiers
Answer: B
Explanation: B) Since a class can implement any number of interfaces, that class is in essence
using the interface classes as if those interfaces were defined in this class. So, this class is
inheriting the methods and constants of the interfaces. Further, the class could extend another
class and thus inherit directly and indirectly from multiple classes. This is not the exact same as
multiple inheritance, but it is as close as Java comes to that concept.
18) Abstract methods are used when defining
A) interface classes
B) derived classes
C) classes that have no constructor
D) arrays
E) classes that have no methods
Answer: A
Explanation: A) An interface is a class that has defined some of its components, but leaves other
components (methods) for you to implement. So, these components (methods) are referred to as
abstract and defined in the interface class as abstract.
7
Copyright © 2015 Pearson Education, Inc.
19) Which of the following is not a method of the Object class?
A) clone
B) compareTo
C) equals
D) toString
E) all of the above are methods of the Object class
Answer: B
Explanation: B) The Object class defines clone to create a copy of any object, equals to
determine if two objects are the same object, and toString to translate an Object into a String.
However, compareTo is not implement by Object and must be explicitly implemented in any
class that wants to implement the Comparable interface.
20) Which of the following interfaces would be used to implement a class that represents a group
(or collection) of objects?
A) Iterator
B) Speaker
C) Comparable
D) MouseListener
E) KeyListener
Answer: A
Explanation: A) Iterator is an abstract class allowing the user to extend a given class that
implements Iterator by using the features defined there. These features include being able to
store a group of objects and iterate (step) through them.
21) In order to implement Comparable in a class, what method(s) must be defined in that class?
A) equals
B) compares
C) both lessThan and greaterThan
D) compareTo
E) both compares and equals
Answer: D
Explanation: D) The Comparable class requires the definition of a compareTo method that will
compare two objects and determine if one is equal to the other, or if one is less than or greater
than the other and respond with a negative int, 0 or a positive int. Since compareTo responds
with 0 if the two objects are equal, there is no need to also define an equals method.
For the questions below, consider a class called ChessPiece. This class has two instance data,
String type and int player. The variable type will store "King", "Queen", "Bishop", etc and the
int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable
for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece
passed as a parameter. Pieces are ordered as follows: "Pawn" is a lesser piece to a "Knight"
and a "Bishop", "Knight" and "Bishop" are equivalent for this example, both are lesser pieces to
a "Rook" which is a lesser piece to a "Queen" which is a lesser piece to a "King."
8
Copyright © 2015 Pearson Education, Inc.
22) Which of the following method headers would properly define the method needed to make
this class Comparable?
A) public boolean comparable(Object cp)
B) public int comparable(Object cp)
C) public int compareTo(Object cp)
D) public int compareTo( )
E) public boolean compareTo(Object cp)
Answer: C
Explanation: C) To implement Comparable, you must implement a method called compareTo
which returns an int. Further, since this class will compare this ChessPiece to another, we would
except the other ChessPiece to be passed in as a parameter (although compareTo is defined to
accept an Object, not a ChessPiece).
23) Which of the following pieces of logic could be used in the method that implements
Comparable? Assume that the method is passed Object a, which is really a ChessPiece. Also
assume that ChessPiece has a method called returnType which returns the type of the given
piece. Only one of these answers has correct logic.
A) if (this.type < a.returnType( )) return -1;
B) if (this.type = = a.returnType( )) return 0;
C) if (this.type.equals(a.returnType( )) return 0;
D) if (a.returnType( ).equals("King")) return -1;
E) if (a.returnType( ).equals("Pawn")) return 1;
Answer: C
Explanation: C) If the type of this piece and of a are the same type, then they are considered
equal and the method should return 0 to indicate this. Note that this does not cover the case
where this piece is a "Knight" and a is a "Bishop", so additional code would be required for the
"equal to" case. The answer in B is not correct because it compares two Strings to see if they are
the same String, not the same value. The logic in D and E are incorrect because neither of these
takes into account what the current piece is, only what the parameter's type is. In D, if a is a
"King", it will be greater than this piece if this piece is not a "King", but will be equal if this
piece is a "King" and similarly in E, it does not consider if this piece is a "Pawn" or not. Finally,
A would give a syntax error because two Strings cannot be compared using the "<" operator.
24) Which of the following would not be considered an algorithm?
A) a recipe
B) a computer program
C) pseudocode
D) a shopping list
E) travel directions
Answer: D
Explanation: D) An algorithm is a step-by-step description of how to solve a problem, written at
some level of specificity. The recipe and probably the pseudocode are written at a "high level"
whereas a program and perhaps travel directions are written in more detail. A shopping list is
not a step-by-step description, so it would not qualify as an algorithm.
9
Copyright © 2015 Pearson Education, Inc.
25) It is important to dissect a problem into manageable pieces before trying to solve the problem
because
A) most problems are too complex to be solved as a single, large activity
B) most problems are solved by multiple people and it is easy to assign each piece to a separate
person
C) it is easier to integrate small pieces of a program into one program than it is to integrate one
big chunk of code into one program
D) our first solution may not solve the problem correctly
E) all of the above
Answer: A
Explanation: A) Any interesting problem will be too complex to solve easily as a single activity.
By decomposing the problem, we can build small solutions to each piece and then integrate the
pieces. Answer D is true, but does is not the reason why we will break a problem down into
pieces.
26) Having multiple class methods of the same name where each method has a different number
of or type of parameters is known as
A) encapsulation
B) information hiding
C) tokenizing
D) importing
E) method overloading
Answer: E
Explanation: E) When methods share the same name, they are said to be overloaded. The
number and type of parameters passed in the message provides the information by which the
proper method is called.
27) The goal of testing is to
A) ensure that the software has no errors
B) find syntax errors
C) find logical and run-time errors
D) evaluate how well the software meets the original requirements
E) give out-of-work programmers something to do
Answer: C
Explanation: C) Testing is required because all software will have errors. Complex systems
especially need testing before they can be released. The types of errors sought are logical errors
and run-time errors. All syntax errors will have been identified and fixed during implementation.
10
Copyright © 2015 Pearson Education, Inc.
28) Arranging components in a GUI container is accomplished by using which of the following?
A) Layout manager
B) Listener interface
C) String array
D) Event generator
E) JComboBox
Answer: A
Explanation: A) There are several classes of Layout managers. A Layout manager is used to
add GUI components to the container in some manner. The type of Layout manager determines
how items are added.
29) Which Layout Manager type would you use if you want GUI components to be placed at the
North, South, East, West and Center of the container?
A) FlowLayout
B) BorderLayout
C) BoxLayout
D) GridLayout
E) TabbedPane
Answer: B
Explanation: B) The BorderLayout specifically allows you to specify the component's location
as one of NORTH, SOUTH, EAST, WEST or CENTER where the value (e.g., NORTH) is a
constant predefined in the class.
30) Which Layout Manager type would you use if you want GUI components to be placed in 2
columns over 5 rows?
A) FlowLayout
B) BorderLayout
C) BoxLayout
D) GridLayout
E) TabbedPane
Answer: D
Explanation: D) The GridLayout manager allows you to specify the number of rows and
columns and then add elements across the column on one row until it is filled, and then on to the
next row, until all of the rows are filled.
31) Which Layout Manager is used by default if you do not specify a Layout Manager for your
GUI container?
A) FlowLayout
B) BorderLayout
C) BoxLayout
D) GridLayout
E) TabbedPane
Answer: A
Explanation: A) The FlowLayout is the default manager. It places GUI items across in one row
only. Other Layout Managers are more sophisticated and lead to better designed containers.
32) Which of the following GUI classes requires that it have a LayoutManager before any GUI
11
Copyright © 2015 Pearson Education, Inc.
components are added to it?
A) JButton
B) JSlider
C) JPanel
D) JFrame
E) both C and D but not A or B
Answer: C
Explanation: C) The JPanel requires adding a LayoutManager to it before any components are
added to it. This allows the components added to be arranged on the JPanel as desired. Neither
the JButton nor JSlider have components added to them and so do not require a LayoutManager.
The JFrame does not use a LayoutManager but instead adds elements through getContentPane( ).
33) In using the BoxLayout, adding space between components in a container can be
accomplished by
A) including TabbedPanes
B) including JButtons that have no names and thus will appear invisible
C) adding invisible components
D) inserting IconImages of blank images
E) any of the above
Answer: C
Explanation: C) The BoxLayout manager allows for the inclusion of specially designated
"invisible" components to take up space between real components and thus provide spacing.
34) In order to display three components vertically in a container, you could use all but which of
the following layout managers?
A) FlowLayout
B) BoxLayout
C) GridLayout
D) BorderLayout
E) you could use any of the above
Answer: A
Explanation: A) FlowLayout puts components horizontally and you cannot change that.
BoxLayout can place items horizontally or vertically. GridLayout allows you to specify the
number of rows and columns and to place the three components vertically, you would use (3, 1)
that is, 3 rows, 1 column. BorderLayout can place three components vertically by placing them
in the NORTH, CENTER and SOUTH positions.
12
Copyright © 2015 Pearson Education, Inc.
35) What is wrong with the following message to create a BoxLayout for the JPanel jp?
jp.setLayout(new BoxLayout(BoxLayout.X_AXIS));
A) X_AXIS is not a valid constant for BoxLayout, it should instead be HORIZONTAL
B) Aside from X_AXIS, the constructor also requires a Dimension to determine the size of the
Box
C) Aside from X_AXIS, the constructor also needs a command regarding horizontal glue as in
createHorizontalGlue( )
D) The BoxLayout constructor is lacking a reference to the container that the BoxLayout
manager will govern
E) There is nothing wrong with it at all
Answer: D
Explanation: D) The BoxLayout manager constructor requires two parameters, a reference to the
container that the manager will govern, and an axis for the layout, (vertical or horizontal) as
specified by either X_AXIS or Y_AXIS.
36) In which phase of program development would you expect the programmer(s) to create the
pseudocode?
A) Software requirements
B) Software design
C) Software implementation
D) Software testing
E) Could occur in any of the above
Answer: B
Explanation: B) Pseudocode is a description of an algorithm written in an English-like way
rather than in a specific programming language. This is part of the program's design. In the
implementation phase, the programmer(s) translates the pseudocode into the programming
language being used.
37) Which of the following is considered a top-level container?
A) Panel
B) Frame
C) Box
D) Layout Manager
E) A, B, and C
Answer: B
Explanation: B) While the answers in A, B and C are all types of containers, the Box and Panel
are made available to contain other components and are themselves placed into other containers.
The Frame is a top-level container because a Frame will not store other Frames, but instead, the
Frame contains Panels which can contain Boxes, Panels and other components.
Other documents randomly have
different content
Little he would have guessed,
(had such a one
watched by his nets,)
that a goddess flung from the crest
of the wave the blue of its own
bright tress of hair,
the blue of the painted stuff
it wore for dress.
No man would have known save he,
whose coming I sensed as I strung
my pearl and agate and pearl,
to mark the beat and the stress
of the lilt of my song.
Who dreams of a son,
save one,
childless, having no bright
face to flatter its own,
who dreams of a son?
Nereids under the sea,
my sisters, fifty and one,
(counting myself)
they dream of a child
of water and sea,
with hair of the softest,
to lie along the curve
of fragile, tiny bones,
yet more beautiful each than each,
hair more bright and long,
to rival its own.
Nereids under the wave,
who dreams of a son
save I, Thetis, alone?
Each would have for a child
Each would have for a child,
a stray self, furtive and wild,
to dive and leap to the wind,
to wheedle and coax
the stray birds bright and bland
of foreign strands,
to crawl and stretch on the sands,
each would have for its own,
a daughter for child.
Who dreams, who sings of a son?
I, Thetis, alone.
When I had finished my song,
and dropped the last seed-pearl,
and flung the necklet
about my throat
and found it none too bright,
not bright enough nor pale
enough, not like the moon that creeps
beneath the sea,
between the lift of crest and crest,
had tried it on
and found it not
quite fair enough
to fill the night
of my blue folds of bluest dress
with moon for light,
I cast the beads aside and leapt,
myself all blue
with no bright gloss
of pearls for crescent light;
but one alert, all blue and wet,
I flung myself, an arrow’s flight,
straight upward
through the blue of night
that was my palace wall,
and crept to where I saw the mark
of feet, a rare foot-fall:
Achilles’ sandal on the beach,
could one mistake?
perhaps a lover or a nymph,
lost from the tangled fern and brake,
that lines the upper shelf of land,
perhaps a goddess or a nymph
might so mistake
Achilles’ footprint for the trace
of a bright god alert to track
the panther where he slinks for thirst
across the sand;
perhaps a goddess or a nymph,
might think a god had crossed the track
of weed and drift,
had broken here this stem of reed,
had turned this sea-shell to the light:
So she must stoop, this goddess girl,
or nymph, with crest of blossoming wood
about her hair for cap or crown,
must stoop and kneel and bending down,
must kiss the print of such a one.
Not I, the mother, Thetis self,
I stretched and lay, a river’s slim
dark length,
a rivulet where it leaves the wood,
and meets the sea,
I lay along the burning sand,
a river’s blue.
At Ithaca
OVER and back,
the long waves crawl
and track the sand with foam;
night darkens and the sea
takes on that desperate tone
of dark that wives put on
when all their love is done.
Over and back,
the tangled thread falls slack,
over and up and on;
over and all is sewn;
now while I bind the end,
I wish some fiery friend
would sweep impetuously
these fingers from the loom.
My weary thoughts
play traitor to my soul,
just as the toil is over;
swift while the woof is whole,
turn now my spirit, swift,
and tear the pattern there,
the flowers so deftly wrought,
the border of sea-blue,
the sea-blue coast of home.
The web was over-fair,
that web of pictures there,
enchantments that I thought
he had, that I had lost;
weaving his happiness
within the stitching frame,
weaving his fire and fame,
I thought my work was done,
I d th t l
I prayed that only one
of those that I had spurned,
might stoop and conquer this
long waiting with a kiss.
But each time that I see
my work so beautifully
inwoven and would keep
the picture and the whole,
Athene steels my soul,
slanting across my brain,
I see as shafts of rain
his chariot and his shafts,
I see the arrows fall,
I see my lord who moves
like Hector, lord of love,
I see him matched with fair
bright rivals and I see
those lesser rivals flee.
We Two
WE two are left:
I with small grace reveal
distaste and bitterness;
you with small patience
take my hands;
though effortless,
you scald their weight
as a bowl, lined with embers,
wherein droop
great petals of white rose,
forced by the heat
too soon to break.
We two are left:
as a blank wall, the world,
earth and the men who talk,
saying their space of life
is good and gracious,
with eyes blank
as that blank surface
their ignorance mistakes
for final shelter
and a resting-place.
We two remain:
yet by what miracle,
searching within the tangles of my brain,
I ask again,
have we two met within
this maze of dædal paths
in-wound mid grievous stone,
where once I stood alone?
Fragment Thirty-six
I know not what to do:
my mind is divided.
SAPPHO
IKNOW not what to do,
my mind is reft:
is song’s gift best?
is love’s gift loveliest?
I know not what to do,
now sleep has pressed
weight on your eyelids.
Shall I break your rest,
devouring, eager?
is love’s gift best?
nay, song’s the loveliest:
yet were you lost,
what rapture
could I take from song?
what song were left?
I know not what to do:
to turn and slake
the rage that burns,
with my breath burn
and trouble your cool breath?
so shall I turn and take
snow in my arms?
(is love’s gift best?)
yet flake on flake
of snow were comfortless,
did you lie wondering,
wakened yet unawake.
Shall I turn and take
comfortless snow within my arms?
press lips to lips
that answer not,
press lips to flesh
th t h dd t b k ?
that shudders not nor breaks?
Is love’s gift best?
shall I turn and slake
all the wild longing?
O I am eager for you!
as the Pleiads shake
white light in whiter water
so shall I take you?
My mind is quite divided,
my minds hesitate,
so perfect matched,
I know not what to do:
each strives with each
as two white wrestlers
standing for a match,
ready to turn and clutch
yet never shake muscle nor nerve nor tendon;
so my mind waits
to grapple with my mind,
yet I lie quiet,
I would seem at rest.
I know not what to do:
strain upon strain,
sound surging upon sound
makes my brain blind;
as a wave-line may wait to fall
yet (waiting for its falling)
still the wind may take
from off its crest,
white flake on flake of foam,
that rises,
seeming to dart and pulse
and rend the light,
so my mind hesitates
y
above the passion
quivering yet to break,
so my mind hesitates
above my mind,
listening to song’s delight.
I know not what to do:
will the sound break,
rending the night
with rift on rift of rose
and scattered light?
will the sound break at last
as the wave hesitant,
or will the whole night pass
and I lie listening awake?
Flute Song
LITTLE scavenger away,
touch not the door,
beat not the portal down,
cross not the sill,
silent until
my song, bright and shrill,
breathes out its lay.
Little scavenger avaunt,
tempt me with jeer and taunt,
yet you will wait to-day;
for it were surely ill
to mock and shout and revel;
it were more fit to tell
with flutes and calathes,
your mother’s praise.
After Troy
WE flung against their gods,
invincible, clear hate;
we fought;
frantic, we flung the last
imperious, desperate shaft
and lost:
we knew the loss
before they ever guessed
fortune had tossed to them
her favour and her whim;
but how were we depressed?
we lost yet as we pressed
our spearsmen on their best,
we knew their line invincible
because there fell
on them no shiverings
of the white enchanteress,
radiant Aphrodite’s spell:
we hurled our shafts of passion,
noblest hate,
and knew their cause was blest,
and knew their gods were nobler,
better taught in skill,
subtler with wit of thought,
yet had it been God’s will
that they not we should fall,
we know those fields had bled
with roses lesser red.
Cassandra
O Hymen king.
HYMEN, O Hymen king,
what bitter thing is this?
what shaft, tearing my heart?
what scar, what light, what fire
searing my eye-balls and my eyes with flame?
nameless, O spoken name,
king, lord, speak blameless Hymen.
Why do you blind my eyes?
why do you dart and pulse
till all the dark is home,
then find my soul
and ruthless draw it back?
scaling the scaleless,
opening the dark?
speak, nameless, power and might;
when will you leave me quite?
when will you break my wings
or leave them utterly free
to scale heaven endlessly?
A bitter, broken thing,
my heart, O Hymen lord,
yet neither drought nor sword
baffles men quite,
why must they feign to fear
my virgin glance?
feigned utterly or real
why do they shrink?
my trance frightens them,
breaks the dance,
empties the market place;
if I but pass they fall
back, frantically;
must always people mock?
unless they shrink and reel
as in the temple
at your uttered will.
O Hymen king,
lord, greatest, power, might,
look for my face is dark,
burnt with your light,
your fire, O Hymen lord;
is there none left
can equal me
in ecstasy, desire?
is there none left
can bear with me
the kiss of your white fire?
is there not one,
Phrygian or frenzied Greek,
poet, song-swept, or bard,
one meet to take from me
this bitter power of song,
one fit to speak, Hymen,
your praises, lord?
May I not wed
as you have wed?
may it not break, beauty,
from out my hands, my head, my feet?
may Love not lie beside me
till his heat
burn me to ash?
may he not comfort me, then,
spent of all that fire and heat,
still, ashen-white and cool
as the wet laurels,
white, before your feet
step on the mountain-slope,
before your fiery hand
before your fiery hand
lift up the mantle
covering flower and land,
as a man lifts,
O Hymen, from his bride,
(cowering with woman eyes,) the veil?
O Hymen lord, be kind.
Epigrams
1
ORUTHLESS, perilous, imperious hate,
you can not thwart
the promptings of my soul,
you can not weaken nay nor dominate
Love that is mateless,
Love the rite,
the whole measure of being:
would you crush with bondage?
nay, you would love me not
were I your slave.
2
TORTURE me not with this or that or this,
Love is my master,
you his lesser self;
while you are Love,
I love you generously,
be Eros,
not a tyrannous, bitter mate:
Love has no charm
when Love is swept to earth:
you’d make a lop-winged god,
frozen and contrite,
of god up-darting,
winged for passionate flight.
Fragment Forty
Love ... bitter-sweet.
SAPPHO
1
KEEP love and he wings
with his bow,
up, mocking us,
keep love and he taunts us
and escapes.
Keep love and he sways apart
in another world,
outdistancing us.
Keep love and he mocks,
ah, bitter and sweet,
your sweetness is more cruel
than your hurt.
Honey and salt,
fire burst from the rocks
to meet fire
spilt from Hesperus.
Fire darted aloft and met fire:
in that moment
love entered us.
2
COULD Eros be kept?
he were prisoned long since
and sick with imprisonment;
could Eros be kept?
others would have broken
and crushed out his life.
Could Eros be kept?
we too sinning, by Kypris,
might have prisoned him outright.
Could Eros be kept?
nay, thank him and the bright goddess
that he left us.
3
AH, love is bitter and sweet,
but which is more sweet,
the sweetness
or the bitterness?
none has spoken it.
Love is bitter,
but can salt taint sea-flowers,
grief, happiness?
Is it bitter to give back
love to your lover
if he crave it?
Is it bitter to give back
love to your lover
if he wish it
for a new favourite?
who can say,
or is it sweet?
Is it sweet
to possess utterly?
or is it bitter,
bitter as ash?
4
I had thought myself frail;
a petal,
with light equal
on leaf and under-leaf.
I had thought myself frail;
a lamp,
shell, ivory or crust of pearl,
about to fall shattered,
with flame spent.
I cried:
“I must perish,
I am deserted,
an outcast, desperate
in this darkness,”
(such fire rent me with Hesperus,)
then the day broke.
5
WHAT need of a lamp
when day lightens
us,
what need to bind love
when love stands
with such radiant wings
over us?
What need—
yet to sing love,
love must first shatter us.
Toward the Piræus
S
LAY with your eyes, Greek,
men over the face of the earth,
slay with your eyes, the host,
puny, passionless, weak.
Break as the ranks of steel
broke when the Persian lost:
craven, we hated them then:
now we would count them Gods
beside these, spawn of the earth.
Grant us your mantle, Greek;
grant us but one
to fright (as your eyes) with a sword,
men, craven and weak,
grant us but one to strike
one blow for you, passionate Greek.
1
YOU would have broken my wings,
but the very fact that you knew
I had wings, set some seal
on my bitter heart, my heart
broke and fluttered and sang.
You would have snared me,
and scattered the strands of my nest;
but the very fact that you saw,
sheltered me, claimed me,
set me apart from the rest
Of men—of men, made you a god,
and me, claimed me, set me apart
and the song in my breast,
yours, yours forever—
if I escape your evil heart.
2
I loved you:
men have writ and women have said
they loved,
but as the Pythoness stands by the altar,
intense and may not move,
till the fumes pass over;
and may not falter or break,
till the priest has caught the words
that mar or make
a deme or a ravaged town;
so I, though my knees tremble,
my heart break,
must note the rumbling,
heed only the shuddering
down in the fissure beneath the rock
of the temple floor;
must wait and watch
and may not turn nor move,
nor break from my trance to speak
so slight, so sweet,
so simple a word as love.
3
WHAT had you done
had you been true,
I can not think,
I may not know.
What could we do
were I not wise,
what play invent,
what joy devise?
What could we do
if you were great?
(Yet were you lost,
who were there then,
to circumvent
the tricks of men?)
What can we do,
for curious lies
have filled your heart,
and in my eyes
sorrow has writ
that I am wise.
4
IF I had been a boy,
I would have worshipped your grace,
I would have flung my worship
before your feet,
I would have followed apart,
glad, rent with an ecstasy
to watch you turn
your great head, set on the throat,
thick, dark with its sinews,
burned and wrought
like the olive stalk,
and the noble chin
and the throat.
I would have stood,
and watched and watched
and burned,
and when in the night,
from the many hosts, your slaves,
and warriors and serving men
you had turned
to the purple couch and the flame
of the woman, tall like the cypress tree
that flames sudden and swift and free
as with crackle of golden resin
and cones and the locks flung free
like the cypress limbs,
bound, caught and shaken and loosed,
bound, caught and riven and bound
and loosened again,
as in rain of a kingly storm
or wind full from a desert plain.
So, when you had risen
from all the lethargy of love and its heat,
you would have summoned me,
me alone,
and found my hands,
beyond all the hands in the world,
cold, cold, cold,
intolerably cold and sweet.
5
IT was not chastity that made me cold nor fear,
only I knew that you, like myself, were sick
of the puny race that crawls and quibbles and lisps
of love and love and lovers and love’s deceit.
It was not chastity that made me wild, but fear
that my weapon, tempered in different heat,
was over-matched by yours, and your hand
skilled to yield death-blows, might break
With the slightest turn—no ill will meant—
my own lesser, yet still somewhat fine-wrought,
fiery-tempered, delicate, over-passionate steel.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
testbankfan.com

Java Software Solutions 8th Edition Lewis Test Bank

  • 1.
    Java Software Solutions8th Edition Lewis Test Bank download https://testbankfan.com/product/java-software-solutions-8th- edition-lewis-test-bank/ Visit testbankfan.com today to download the complete set of test bank or solution manual
  • 2.
    We believe theseproducts will be a great fit for you. Click the link to download now, or visit testbankfan.com to discover even more! Java Software Solutions 8th Edition Lewis Solutions Manual https://testbankfan.com/product/java-software-solutions-8th-edition- lewis-solutions-manual/ Java Software Solutions 9th Edition Lewis Test Bank https://testbankfan.com/product/java-software-solutions-9th-edition- lewis-test-bank/ Java Software Solutions 9th Edition Lewis Solutions Manual https://testbankfan.com/product/java-software-solutions-9th-edition- lewis-solutions-manual/ Essentials of Psychiatric Mental Health Nursing 1st Edition Varcarolis Test Bank https://testbankfan.com/product/essentials-of-psychiatric-mental- health-nursing-1st-edition-varcarolis-test-bank/
  • 3.
    Discrete Mathematics withApplications 4th Edition Susanna Solutions Manual https://testbankfan.com/product/discrete-mathematics-with- applications-4th-edition-susanna-solutions-manual/ Law for Business 11th Edition Barnes Test Bank https://testbankfan.com/product/law-for-business-11th-edition-barnes- test-bank/ Understanding Cross Cultural Management 2nd Edition Browaeys Solutions Manual https://testbankfan.com/product/understanding-cross-cultural- management-2nd-edition-browaeys-solutions-manual/ Organizational Behavior A Critical Thinking Approach 1st Edition Neck Solutions Manual https://testbankfan.com/product/organizational-behavior-a-critical- thinking-approach-1st-edition-neck-solutions-manual/ Principles of Leadership International 7th Edition DuBrin Test Bank https://testbankfan.com/product/principles-of-leadership- international-edition-7th-edition-dubrin-test-bank/
  • 4.
    Sociology in OurTimes 9th Edition Diana Test Bank https://testbankfan.com/product/sociology-in-our-times-9th-edition- diana-test-bank/
  • 5.
    1 Copyright © 2015Pearson Education, Inc. Java Software Solutions, 8e (Lewis/Loftus) Chapter 7 Object-Oriented Design 7.1 Multiple-Choice Questions 1) During program development, software requirements specify A) how the program will accomplish the task B) what the task is that the program must perform C) how to divide the task into subtasks D) how to test the program when it is done E) all of the above Answer: B Explanation: B) The specification phase is to understand the problem at hand so that the programmer can determine what needs to be done to solve the problem. The other efforts listed above are part of the design phase (A, C) and testing phase (D). 2) Once we have implemented the solution, we are not done with the problem because A) the solution may not be the best (most efficient) B) the solution may have errors and need testing and fixing before we are done C) the solution may, at a later date, need revising to handle new specifications D) the solution may, at a later date, need revising because of new programming language features E) all of the above Answer: E Explanation: E) A program should not be considered as a finished product until we are reasonably assured that it is efficient and error-free. Further, it is common that programs require modification in the future because of a change to specifications or a change to the language or computer running the program. 3) Of the various phases in software development, which of the following is usually the lengthiest? A) specification B) design C) implementation D) testing E) maintenance Answer: E Explanation: E) The maintenance phase exists for as long as the software is in use. Software requires modification (such as new requirements such as new features or I/O specifications) and so the maintenance phase is on-going whereas the other phases end once the software has been released and is in use.
  • 6.
    2 Copyright © 2015Pearson Education, Inc. 4) A bad programming habit is to build an initial program and then spend a great deal of time modifying the code until it is acceptable. This is known as A) the prototyping approach B) the waterfall model C) iterative development D) the recursive approach E) the build-and-fix approach Answer: E Explanation: E) Programmers who do not think things through will often build a program that does not fit the original requirements. They then spend an inordinate amount of time trying to repair the program to more properly fit. This is known as "build-and-fix" and is a poor programming practice. 5) The activities of the development cycle are generally thought to A) be strictly linear B) be rigidly ordered C) overlap D) have optional steps E) both A and B are true Answer: C Explanation: C) A flaw of the waterfall model is that it does not permit repetition or backtracking through the development cycle. However, phases often need revisiting resulting in a development cycle where the development activities overlap. 6) The idea of having programmers and developers meet in order to critique a software design or implementation is known as A) an interview B) a walkthrough C) prototyping D) aggregation E) evolutionary development Answer: B Explanation: B) Such meetings are very useful so that the various members can analyze the solution to that point in time and offer suggestions to enhance the design and implementation. This is called a walkthrough because it involves going step-by-step through the proposed or implemented design.
  • 7.
    3 Copyright © 2015Pearson Education, Inc. 7) Modifying a program in order to eliminate deficiencies is done in the ________ phase of the development cycle. A) design B) implementation C) testing D) use E) maintenance Answer: E Explanation: E) While testing is used to find errors, deficiencies are more commonly identified by the users of the system once the system has been released. After such deficiencies have been identified, it is up to the software maintenance group to eliminate them in future versions of the software. 8) It is easier to correct errors found in a program if A) they are identified early in the development cycle B) they are identified during testing C) they are identified during program use D) they are identified during maintenance E) all of the above are equally true, errors are easily corrected in any of these stages Answer: A Explanation: A) Errors introduced early in the development cycle often cause tremendous problems if not caught early on. Therefore, errors found in testing, use or maintenance phases may be too embedded in the systems' design to be easily corrected. But if found early on, the errors can be completely eliminated. 9) In general, spending more time in development to ensure better software will A) shorten testing time B) slightly reduce maintenance efforts C) slightly increase maintenance efforts D) greatly reduce maintenance efforts E) not alter the time it takes for any other stage whatsoever Answer: D Explanation: D) Spending more time in development promises better software, which in turn leads to less maintenance effort.
  • 8.
    4 Copyright © 2015Pearson Education, Inc. 10) The idea that an object can exist separate from the executing program that creates it is called A) transience B) static C) persistence D) serialization E) finality Answer: C Explanation: C) Objects are stored in memory and are reclaimed by the garbage collector when they are no longer referenced. When a Java program terminates, no object is referenced and so all objects are reclaimed. It is desirable, however, to be able to save any given object for future use. This trait is called persistence, and the ability to do this is by saving the instance data of the object to a file. This can be done by writing each instance data to a data file, but is simplified using Object Serialization. 11) In order to create a constant, you would use which of the following Java reserved words? A) private B) static C) int D) final E) class Answer: D Explanation: D) The reserved word final indicates that this is the final value that will be stored in this variable, thus making it unchangeable, or constant. While constants can be of type int, constants can be of any other type as well. It is the final reserved word that makes the value unchangeable. 12) Which of the following methods is a static method? The class in which the method is defined is given in parentheses following the method name. A) equals (String) B) toUpperCase (String) C) sqrt (Math) D) format (DecimalFormat) E) paint (Applet) Answer: C Explanation: C) The Math class defines all of its methods to be static. Invoking Math methods is done by using Math rather than a variable of type Math. The other methods above are not static.
  • 9.
    5 Copyright © 2015Pearson Education, Inc. 13) Static methods cannot A) reference instance data B) reference non-static instance data C) reference other objects D) invoke other static methods E) invoke non-static methods Answer: B Explanation: B) A static method is a method that is part of the class itself, not an instantiated object, and therefore the static method is shared among all instantiated objects of the class. Since the static method is shared, it cannot access non-static instance data because all non-static instance data are specific to instantiated objects. A static method can access static instance data because, like the method, the instance data is shared among all objects of the class. A static method can also access parameters passed to it. 14) An object that refers to part of itself within its own methods can use which of the following reserved words to denote this relationship? A) inner B) i C) private D) this E) static Answer: D Explanation: D) The reserved word this is used so that an object can refer to itself. For instance, if an object has an instance data x, then this.x refers to the object's value x. While this is not necessary, it can be useful if a local variable or parameter is named the same as an instance data. The reserved word this is also used to refer to the class as a whole, for instance, if the class is going to implement an interface class rather than import an implementation of an interface class. 15) An example of an aggregation relationship is A) parent and child B) animal and dog C) teacher and computer D) phone and fax machine E) all of the above Answer: C Explanation: C) An aggregate relationship describes how one object accomplishes a task by using another object. In the above list, the teacher uses the computer. The relationship in A is one of lineage (possibly ownership), in B is an is-a relationship as a dog is a child class of animal, and in D is one of similarity, phone and fax machine might be thought of as sibling classes, related to each other in that they are both children of a more general communication class.
  • 10.
    6 Copyright © 2015Pearson Education, Inc. 16) Inheritance through an extended (derived) class supports which of the following concepts? A) interfaces B) modulary C) information hiding D) code reuse E) correctness Answer: D Explanation: D) By extending a class and inheriting from it, the new class does not have to reimplement any of those inherited methods or instance data, thus saving the programmer an effort. So, code reuse is the ability to reuse someone else's code for your benefit by extending it for your need. 17) Java does not support multiple inheritance, but some of the abilities of multiple inheritance are available by A) importing classes B) implementing interfaces C) overriding parent class methods D) creating aliases E) using public rather than protected or private modifiers Answer: B Explanation: B) Since a class can implement any number of interfaces, that class is in essence using the interface classes as if those interfaces were defined in this class. So, this class is inheriting the methods and constants of the interfaces. Further, the class could extend another class and thus inherit directly and indirectly from multiple classes. This is not the exact same as multiple inheritance, but it is as close as Java comes to that concept. 18) Abstract methods are used when defining A) interface classes B) derived classes C) classes that have no constructor D) arrays E) classes that have no methods Answer: A Explanation: A) An interface is a class that has defined some of its components, but leaves other components (methods) for you to implement. So, these components (methods) are referred to as abstract and defined in the interface class as abstract.
  • 11.
    7 Copyright © 2015Pearson Education, Inc. 19) Which of the following is not a method of the Object class? A) clone B) compareTo C) equals D) toString E) all of the above are methods of the Object class Answer: B Explanation: B) The Object class defines clone to create a copy of any object, equals to determine if two objects are the same object, and toString to translate an Object into a String. However, compareTo is not implement by Object and must be explicitly implemented in any class that wants to implement the Comparable interface. 20) Which of the following interfaces would be used to implement a class that represents a group (or collection) of objects? A) Iterator B) Speaker C) Comparable D) MouseListener E) KeyListener Answer: A Explanation: A) Iterator is an abstract class allowing the user to extend a given class that implements Iterator by using the features defined there. These features include being able to store a group of objects and iterate (step) through them. 21) In order to implement Comparable in a class, what method(s) must be defined in that class? A) equals B) compares C) both lessThan and greaterThan D) compareTo E) both compares and equals Answer: D Explanation: D) The Comparable class requires the definition of a compareTo method that will compare two objects and determine if one is equal to the other, or if one is less than or greater than the other and respond with a negative int, 0 or a positive int. Since compareTo responds with 0 if the two objects are equal, there is no need to also define an equals method. For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The variable type will store "King", "Queen", "Bishop", etc and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter. Pieces are ordered as follows: "Pawn" is a lesser piece to a "Knight" and a "Bishop", "Knight" and "Bishop" are equivalent for this example, both are lesser pieces to a "Rook" which is a lesser piece to a "Queen" which is a lesser piece to a "King."
  • 12.
    8 Copyright © 2015Pearson Education, Inc. 22) Which of the following method headers would properly define the method needed to make this class Comparable? A) public boolean comparable(Object cp) B) public int comparable(Object cp) C) public int compareTo(Object cp) D) public int compareTo( ) E) public boolean compareTo(Object cp) Answer: C Explanation: C) To implement Comparable, you must implement a method called compareTo which returns an int. Further, since this class will compare this ChessPiece to another, we would except the other ChessPiece to be passed in as a parameter (although compareTo is defined to accept an Object, not a ChessPiece). 23) Which of the following pieces of logic could be used in the method that implements Comparable? Assume that the method is passed Object a, which is really a ChessPiece. Also assume that ChessPiece has a method called returnType which returns the type of the given piece. Only one of these answers has correct logic. A) if (this.type < a.returnType( )) return -1; B) if (this.type = = a.returnType( )) return 0; C) if (this.type.equals(a.returnType( )) return 0; D) if (a.returnType( ).equals("King")) return -1; E) if (a.returnType( ).equals("Pawn")) return 1; Answer: C Explanation: C) If the type of this piece and of a are the same type, then they are considered equal and the method should return 0 to indicate this. Note that this does not cover the case where this piece is a "Knight" and a is a "Bishop", so additional code would be required for the "equal to" case. The answer in B is not correct because it compares two Strings to see if they are the same String, not the same value. The logic in D and E are incorrect because neither of these takes into account what the current piece is, only what the parameter's type is. In D, if a is a "King", it will be greater than this piece if this piece is not a "King", but will be equal if this piece is a "King" and similarly in E, it does not consider if this piece is a "Pawn" or not. Finally, A would give a syntax error because two Strings cannot be compared using the "<" operator. 24) Which of the following would not be considered an algorithm? A) a recipe B) a computer program C) pseudocode D) a shopping list E) travel directions Answer: D Explanation: D) An algorithm is a step-by-step description of how to solve a problem, written at some level of specificity. The recipe and probably the pseudocode are written at a "high level" whereas a program and perhaps travel directions are written in more detail. A shopping list is not a step-by-step description, so it would not qualify as an algorithm.
  • 13.
    9 Copyright © 2015Pearson Education, Inc. 25) It is important to dissect a problem into manageable pieces before trying to solve the problem because A) most problems are too complex to be solved as a single, large activity B) most problems are solved by multiple people and it is easy to assign each piece to a separate person C) it is easier to integrate small pieces of a program into one program than it is to integrate one big chunk of code into one program D) our first solution may not solve the problem correctly E) all of the above Answer: A Explanation: A) Any interesting problem will be too complex to solve easily as a single activity. By decomposing the problem, we can build small solutions to each piece and then integrate the pieces. Answer D is true, but does is not the reason why we will break a problem down into pieces. 26) Having multiple class methods of the same name where each method has a different number of or type of parameters is known as A) encapsulation B) information hiding C) tokenizing D) importing E) method overloading Answer: E Explanation: E) When methods share the same name, they are said to be overloaded. The number and type of parameters passed in the message provides the information by which the proper method is called. 27) The goal of testing is to A) ensure that the software has no errors B) find syntax errors C) find logical and run-time errors D) evaluate how well the software meets the original requirements E) give out-of-work programmers something to do Answer: C Explanation: C) Testing is required because all software will have errors. Complex systems especially need testing before they can be released. The types of errors sought are logical errors and run-time errors. All syntax errors will have been identified and fixed during implementation.
  • 14.
    10 Copyright © 2015Pearson Education, Inc. 28) Arranging components in a GUI container is accomplished by using which of the following? A) Layout manager B) Listener interface C) String array D) Event generator E) JComboBox Answer: A Explanation: A) There are several classes of Layout managers. A Layout manager is used to add GUI components to the container in some manner. The type of Layout manager determines how items are added. 29) Which Layout Manager type would you use if you want GUI components to be placed at the North, South, East, West and Center of the container? A) FlowLayout B) BorderLayout C) BoxLayout D) GridLayout E) TabbedPane Answer: B Explanation: B) The BorderLayout specifically allows you to specify the component's location as one of NORTH, SOUTH, EAST, WEST or CENTER where the value (e.g., NORTH) is a constant predefined in the class. 30) Which Layout Manager type would you use if you want GUI components to be placed in 2 columns over 5 rows? A) FlowLayout B) BorderLayout C) BoxLayout D) GridLayout E) TabbedPane Answer: D Explanation: D) The GridLayout manager allows you to specify the number of rows and columns and then add elements across the column on one row until it is filled, and then on to the next row, until all of the rows are filled. 31) Which Layout Manager is used by default if you do not specify a Layout Manager for your GUI container? A) FlowLayout B) BorderLayout C) BoxLayout D) GridLayout E) TabbedPane Answer: A Explanation: A) The FlowLayout is the default manager. It places GUI items across in one row only. Other Layout Managers are more sophisticated and lead to better designed containers. 32) Which of the following GUI classes requires that it have a LayoutManager before any GUI
  • 15.
    11 Copyright © 2015Pearson Education, Inc. components are added to it? A) JButton B) JSlider C) JPanel D) JFrame E) both C and D but not A or B Answer: C Explanation: C) The JPanel requires adding a LayoutManager to it before any components are added to it. This allows the components added to be arranged on the JPanel as desired. Neither the JButton nor JSlider have components added to them and so do not require a LayoutManager. The JFrame does not use a LayoutManager but instead adds elements through getContentPane( ). 33) In using the BoxLayout, adding space between components in a container can be accomplished by A) including TabbedPanes B) including JButtons that have no names and thus will appear invisible C) adding invisible components D) inserting IconImages of blank images E) any of the above Answer: C Explanation: C) The BoxLayout manager allows for the inclusion of specially designated "invisible" components to take up space between real components and thus provide spacing. 34) In order to display three components vertically in a container, you could use all but which of the following layout managers? A) FlowLayout B) BoxLayout C) GridLayout D) BorderLayout E) you could use any of the above Answer: A Explanation: A) FlowLayout puts components horizontally and you cannot change that. BoxLayout can place items horizontally or vertically. GridLayout allows you to specify the number of rows and columns and to place the three components vertically, you would use (3, 1) that is, 3 rows, 1 column. BorderLayout can place three components vertically by placing them in the NORTH, CENTER and SOUTH positions.
  • 16.
    12 Copyright © 2015Pearson Education, Inc. 35) What is wrong with the following message to create a BoxLayout for the JPanel jp? jp.setLayout(new BoxLayout(BoxLayout.X_AXIS)); A) X_AXIS is not a valid constant for BoxLayout, it should instead be HORIZONTAL B) Aside from X_AXIS, the constructor also requires a Dimension to determine the size of the Box C) Aside from X_AXIS, the constructor also needs a command regarding horizontal glue as in createHorizontalGlue( ) D) The BoxLayout constructor is lacking a reference to the container that the BoxLayout manager will govern E) There is nothing wrong with it at all Answer: D Explanation: D) The BoxLayout manager constructor requires two parameters, a reference to the container that the manager will govern, and an axis for the layout, (vertical or horizontal) as specified by either X_AXIS or Y_AXIS. 36) In which phase of program development would you expect the programmer(s) to create the pseudocode? A) Software requirements B) Software design C) Software implementation D) Software testing E) Could occur in any of the above Answer: B Explanation: B) Pseudocode is a description of an algorithm written in an English-like way rather than in a specific programming language. This is part of the program's design. In the implementation phase, the programmer(s) translates the pseudocode into the programming language being used. 37) Which of the following is considered a top-level container? A) Panel B) Frame C) Box D) Layout Manager E) A, B, and C Answer: B Explanation: B) While the answers in A, B and C are all types of containers, the Box and Panel are made available to contain other components and are themselves placed into other containers. The Frame is a top-level container because a Frame will not store other Frames, but instead, the Frame contains Panels which can contain Boxes, Panels and other components.
  • 17.
    Other documents randomlyhave different content
  • 18.
    Little he wouldhave guessed, (had such a one watched by his nets,) that a goddess flung from the crest of the wave the blue of its own bright tress of hair, the blue of the painted stuff it wore for dress. No man would have known save he, whose coming I sensed as I strung my pearl and agate and pearl, to mark the beat and the stress of the lilt of my song. Who dreams of a son, save one, childless, having no bright face to flatter its own, who dreams of a son? Nereids under the sea, my sisters, fifty and one, (counting myself) they dream of a child of water and sea, with hair of the softest, to lie along the curve of fragile, tiny bones, yet more beautiful each than each, hair more bright and long, to rival its own. Nereids under the wave, who dreams of a son save I, Thetis, alone? Each would have for a child
  • 19.
    Each would havefor a child, a stray self, furtive and wild, to dive and leap to the wind, to wheedle and coax the stray birds bright and bland of foreign strands, to crawl and stretch on the sands, each would have for its own, a daughter for child. Who dreams, who sings of a son? I, Thetis, alone. When I had finished my song, and dropped the last seed-pearl, and flung the necklet about my throat and found it none too bright, not bright enough nor pale enough, not like the moon that creeps beneath the sea, between the lift of crest and crest, had tried it on and found it not quite fair enough to fill the night of my blue folds of bluest dress with moon for light, I cast the beads aside and leapt, myself all blue with no bright gloss of pearls for crescent light; but one alert, all blue and wet, I flung myself, an arrow’s flight, straight upward through the blue of night
  • 20.
    that was mypalace wall, and crept to where I saw the mark of feet, a rare foot-fall: Achilles’ sandal on the beach, could one mistake? perhaps a lover or a nymph, lost from the tangled fern and brake, that lines the upper shelf of land, perhaps a goddess or a nymph might so mistake Achilles’ footprint for the trace of a bright god alert to track the panther where he slinks for thirst across the sand; perhaps a goddess or a nymph, might think a god had crossed the track of weed and drift, had broken here this stem of reed, had turned this sea-shell to the light: So she must stoop, this goddess girl, or nymph, with crest of blossoming wood about her hair for cap or crown, must stoop and kneel and bending down, must kiss the print of such a one. Not I, the mother, Thetis self, I stretched and lay, a river’s slim dark length, a rivulet where it leaves the wood, and meets the sea, I lay along the burning sand, a river’s blue.
  • 21.
  • 22.
    OVER and back, thelong waves crawl and track the sand with foam; night darkens and the sea takes on that desperate tone of dark that wives put on when all their love is done. Over and back, the tangled thread falls slack, over and up and on; over and all is sewn; now while I bind the end, I wish some fiery friend would sweep impetuously these fingers from the loom. My weary thoughts play traitor to my soul, just as the toil is over; swift while the woof is whole, turn now my spirit, swift, and tear the pattern there, the flowers so deftly wrought, the border of sea-blue, the sea-blue coast of home. The web was over-fair, that web of pictures there, enchantments that I thought he had, that I had lost; weaving his happiness within the stitching frame, weaving his fire and fame, I thought my work was done, I d th t l
  • 23.
    I prayed thatonly one of those that I had spurned, might stoop and conquer this long waiting with a kiss. But each time that I see my work so beautifully inwoven and would keep the picture and the whole, Athene steels my soul, slanting across my brain, I see as shafts of rain his chariot and his shafts, I see the arrows fall, I see my lord who moves like Hector, lord of love, I see him matched with fair bright rivals and I see those lesser rivals flee.
  • 24.
  • 25.
    WE two areleft: I with small grace reveal distaste and bitterness; you with small patience take my hands; though effortless, you scald their weight as a bowl, lined with embers, wherein droop great petals of white rose, forced by the heat too soon to break. We two are left: as a blank wall, the world, earth and the men who talk, saying their space of life is good and gracious, with eyes blank as that blank surface their ignorance mistakes for final shelter and a resting-place. We two remain: yet by what miracle, searching within the tangles of my brain, I ask again, have we two met within this maze of dædal paths in-wound mid grievous stone, where once I stood alone?
  • 26.
    Fragment Thirty-six I knownot what to do: my mind is divided. SAPPHO
  • 27.
    IKNOW not whatto do, my mind is reft: is song’s gift best? is love’s gift loveliest? I know not what to do, now sleep has pressed weight on your eyelids. Shall I break your rest, devouring, eager? is love’s gift best? nay, song’s the loveliest: yet were you lost, what rapture could I take from song? what song were left? I know not what to do: to turn and slake the rage that burns, with my breath burn and trouble your cool breath? so shall I turn and take snow in my arms? (is love’s gift best?) yet flake on flake of snow were comfortless, did you lie wondering, wakened yet unawake. Shall I turn and take comfortless snow within my arms? press lips to lips that answer not, press lips to flesh th t h dd t b k ?
  • 28.
    that shudders notnor breaks? Is love’s gift best? shall I turn and slake all the wild longing? O I am eager for you! as the Pleiads shake white light in whiter water so shall I take you? My mind is quite divided, my minds hesitate, so perfect matched, I know not what to do: each strives with each as two white wrestlers standing for a match, ready to turn and clutch yet never shake muscle nor nerve nor tendon; so my mind waits to grapple with my mind, yet I lie quiet, I would seem at rest. I know not what to do: strain upon strain, sound surging upon sound makes my brain blind; as a wave-line may wait to fall yet (waiting for its falling) still the wind may take from off its crest, white flake on flake of foam, that rises, seeming to dart and pulse and rend the light, so my mind hesitates
  • 29.
    y above the passion quiveringyet to break, so my mind hesitates above my mind, listening to song’s delight. I know not what to do: will the sound break, rending the night with rift on rift of rose and scattered light? will the sound break at last as the wave hesitant, or will the whole night pass and I lie listening awake?
  • 30.
    Flute Song LITTLE scavengeraway, touch not the door, beat not the portal down, cross not the sill, silent until my song, bright and shrill, breathes out its lay. Little scavenger avaunt, tempt me with jeer and taunt, yet you will wait to-day; for it were surely ill to mock and shout and revel; it were more fit to tell with flutes and calathes, your mother’s praise.
  • 31.
    After Troy WE flungagainst their gods, invincible, clear hate; we fought; frantic, we flung the last imperious, desperate shaft and lost: we knew the loss before they ever guessed fortune had tossed to them her favour and her whim; but how were we depressed? we lost yet as we pressed our spearsmen on their best, we knew their line invincible because there fell on them no shiverings of the white enchanteress, radiant Aphrodite’s spell: we hurled our shafts of passion, noblest hate, and knew their cause was blest, and knew their gods were nobler, better taught in skill, subtler with wit of thought, yet had it been God’s will that they not we should fall, we know those fields had bled with roses lesser red.
  • 32.
  • 33.
    HYMEN, O Hymenking, what bitter thing is this? what shaft, tearing my heart? what scar, what light, what fire searing my eye-balls and my eyes with flame? nameless, O spoken name, king, lord, speak blameless Hymen. Why do you blind my eyes? why do you dart and pulse till all the dark is home, then find my soul and ruthless draw it back? scaling the scaleless, opening the dark? speak, nameless, power and might; when will you leave me quite? when will you break my wings or leave them utterly free to scale heaven endlessly? A bitter, broken thing, my heart, O Hymen lord, yet neither drought nor sword baffles men quite, why must they feign to fear my virgin glance? feigned utterly or real why do they shrink? my trance frightens them, breaks the dance, empties the market place; if I but pass they fall back, frantically; must always people mock?
  • 34.
    unless they shrinkand reel as in the temple at your uttered will. O Hymen king, lord, greatest, power, might, look for my face is dark, burnt with your light, your fire, O Hymen lord; is there none left can equal me in ecstasy, desire? is there none left can bear with me the kiss of your white fire? is there not one, Phrygian or frenzied Greek, poet, song-swept, or bard, one meet to take from me this bitter power of song, one fit to speak, Hymen, your praises, lord? May I not wed as you have wed? may it not break, beauty, from out my hands, my head, my feet? may Love not lie beside me till his heat burn me to ash? may he not comfort me, then, spent of all that fire and heat, still, ashen-white and cool as the wet laurels, white, before your feet step on the mountain-slope, before your fiery hand
  • 35.
    before your fieryhand lift up the mantle covering flower and land, as a man lifts, O Hymen, from his bride, (cowering with woman eyes,) the veil? O Hymen lord, be kind.
  • 36.
    Epigrams 1 ORUTHLESS, perilous, imperioushate, you can not thwart the promptings of my soul, you can not weaken nay nor dominate Love that is mateless, Love the rite, the whole measure of being: would you crush with bondage? nay, you would love me not were I your slave. 2 TORTURE me not with this or that or this, Love is my master, you his lesser self; while you are Love, I love you generously, be Eros, not a tyrannous, bitter mate: Love has no charm when Love is swept to earth: you’d make a lop-winged god, frozen and contrite, of god up-darting, winged for passionate flight.
  • 37.
    Fragment Forty Love ...bitter-sweet. SAPPHO 1 KEEP love and he wings with his bow, up, mocking us, keep love and he taunts us and escapes. Keep love and he sways apart in another world, outdistancing us. Keep love and he mocks, ah, bitter and sweet, your sweetness is more cruel than your hurt. Honey and salt, fire burst from the rocks to meet fire spilt from Hesperus. Fire darted aloft and met fire: in that moment love entered us. 2
  • 38.
    COULD Eros bekept? he were prisoned long since and sick with imprisonment; could Eros be kept? others would have broken and crushed out his life. Could Eros be kept? we too sinning, by Kypris, might have prisoned him outright. Could Eros be kept? nay, thank him and the bright goddess that he left us. 3
  • 39.
    AH, love isbitter and sweet, but which is more sweet, the sweetness or the bitterness? none has spoken it. Love is bitter, but can salt taint sea-flowers, grief, happiness? Is it bitter to give back love to your lover if he crave it? Is it bitter to give back love to your lover if he wish it for a new favourite? who can say, or is it sweet? Is it sweet to possess utterly? or is it bitter, bitter as ash? 4
  • 40.
    I had thoughtmyself frail; a petal, with light equal on leaf and under-leaf. I had thought myself frail; a lamp, shell, ivory or crust of pearl, about to fall shattered, with flame spent. I cried: “I must perish, I am deserted, an outcast, desperate in this darkness,” (such fire rent me with Hesperus,) then the day broke. 5 WHAT need of a lamp when day lightens us, what need to bind love when love stands with such radiant wings over us? What need— yet to sing love, love must first shatter us.
  • 41.
    Toward the Piræus S LAYwith your eyes, Greek, men over the face of the earth, slay with your eyes, the host, puny, passionless, weak. Break as the ranks of steel broke when the Persian lost: craven, we hated them then: now we would count them Gods beside these, spawn of the earth. Grant us your mantle, Greek; grant us but one to fright (as your eyes) with a sword, men, craven and weak, grant us but one to strike one blow for you, passionate Greek. 1
  • 42.
    YOU would havebroken my wings, but the very fact that you knew I had wings, set some seal on my bitter heart, my heart broke and fluttered and sang. You would have snared me, and scattered the strands of my nest; but the very fact that you saw, sheltered me, claimed me, set me apart from the rest Of men—of men, made you a god, and me, claimed me, set me apart and the song in my breast, yours, yours forever— if I escape your evil heart. 2
  • 43.
    I loved you: menhave writ and women have said they loved, but as the Pythoness stands by the altar, intense and may not move, till the fumes pass over; and may not falter or break, till the priest has caught the words that mar or make a deme or a ravaged town; so I, though my knees tremble, my heart break, must note the rumbling, heed only the shuddering down in the fissure beneath the rock of the temple floor; must wait and watch and may not turn nor move, nor break from my trance to speak so slight, so sweet, so simple a word as love. 3
  • 44.
    WHAT had youdone had you been true, I can not think, I may not know. What could we do were I not wise, what play invent, what joy devise? What could we do if you were great? (Yet were you lost, who were there then, to circumvent the tricks of men?) What can we do, for curious lies have filled your heart, and in my eyes sorrow has writ that I am wise. 4
  • 45.
    IF I hadbeen a boy, I would have worshipped your grace, I would have flung my worship before your feet, I would have followed apart, glad, rent with an ecstasy to watch you turn your great head, set on the throat, thick, dark with its sinews, burned and wrought like the olive stalk, and the noble chin and the throat. I would have stood, and watched and watched and burned, and when in the night, from the many hosts, your slaves, and warriors and serving men you had turned to the purple couch and the flame of the woman, tall like the cypress tree that flames sudden and swift and free as with crackle of golden resin and cones and the locks flung free like the cypress limbs, bound, caught and shaken and loosed, bound, caught and riven and bound and loosened again, as in rain of a kingly storm or wind full from a desert plain. So, when you had risen from all the lethargy of love and its heat,
  • 46.
    you would havesummoned me, me alone, and found my hands, beyond all the hands in the world, cold, cold, cold, intolerably cold and sweet. 5 IT was not chastity that made me cold nor fear, only I knew that you, like myself, were sick of the puny race that crawls and quibbles and lisps of love and love and lovers and love’s deceit. It was not chastity that made me wild, but fear that my weapon, tempered in different heat, was over-matched by yours, and your hand skilled to yield death-blows, might break With the slightest turn—no ill will meant— my own lesser, yet still somewhat fine-wrought, fiery-tempered, delicate, over-passionate steel.
  • 47.
    Welcome to ourwebsite – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! testbankfan.com