Está en la página 1de 18

Submitted by Miller, Jean (G00453830) on 11/16/2012 2:59:28 PM

Points Awarded

0.00

Points Missed

0.00

Percentage

0%

1.
In the UML, a classs attributes are placed in the _____ compartment of the classs rectangle.
A) first
B) second
C) third
D) bottom
Points Earned:
Correct Answer(s):

0.0/0.0
B

2.
To catch an exception, the code that might throw the exception must be enclosed in a _____.
A) throws block
B) catch block
C) try block
D) finally block
Points Earned:
Correct Answer(s):

0.0/0.0
C

3.
The _____ of a class are also called the public services or the public interface that the class
provides to its clients.

A) public constructors
B) public instance variables
C) public methods
D) all of the above
Points Earned:
Correct Answer(s):

0.0/0.0
D

4.
A default constructor has how many parameters?
A) 0
B) 1
C) 2
D) variable
Points Earned:
Correct Answer(s):

0.0/0.0
A

5.
An object is an instance of a _____.
A) program
B) class
C) method
D) data
Points Earned:
Correct Answer(s):

6.

0.0/0.0
B

You use the keyword _____ to reference a method in the superclass from a subclass.
A) super
B) superObject
C) that
D) this
Points Earned:
Correct Answer(s):

0.0/0.0
A

7.
Every class in Java, except _____, extends an existing class.
A) Integer
B) Object
C) String
D) Class
Points Earned:
Correct Answer(s):

0.0/0.0
B

8.
Together, the appearance and the way in which the user interacts with the application are known
as that applications _____.
A) abstract window toolkit
B) look-and-feel
C) swing factor
D) All of the above
Points Earned:
Correct Answer(s):

0.0/0.0
B

9.
What type of methods allow a client of a class to assign values to a private instance variable?
A) Get methods
B) Replace methods
C) Assign methods
D) Set methods
Points Earned:
Correct Answer(s):

0.0/0.0
D

10.
A programmer-defined constructor that has no arguments is called a _____.
A) zero-argument constructor
B) no-argument constructor
C) default constructor
D) main constructor
Points Earned:
Correct Answer(s):

0.0/0.0
B

11.
Which layout manager is the default for JFrame?
A) FlowLayout
B) BorderLayout
C) GridLayout
D) none of the above
Points Earned:
Correct Answer(s):

0.0/0.0
B

12.
The static method _____ of class String returns a formatted String.
A) printf
B) format
C) formatString
D) toFormatString
Points Earned:
Correct Answer(s):

0.0/0.0
B

13.
The _____ of a class are also called the public services or the public interface that the class
provides to its clients.
A) public constructors
B) public instance variables
C) public methods
D) all of the above
Points Earned:
Correct Answer(s):

0.0/0.0
D

14.
An advantage of inheritance is that _____.
A) all methods can be inherited
B) all instance variables can be uniformly accessed by subclasses and superclasses
C) objects of a subclass can be treated like objects of their superclass
D) none of the above
Points Earned:
Correct Answer(s):

0.0/0.0
C

15.
The UML represents operations by listing the operation name, followed by a _____-separated list
of parameters in parentheses, a _____ and the return type.
A) colon; semicolon
B) colon; colon
C) comma; colon
D) comma; semicolon
Points Earned:
Correct Answer(s):

0.0/0.0
C

16.
It is a UML convention to denote the name of an abstract class in _____.
A) bold
B) italics
C) a diamond
D) There is no convention of the UML to denote abstract classesthey are listed just as any
other class.
Points Earned:
Correct Answer(s):

0.0/0.0
B

17.
What type of methods allow a client of a class to assign values to a private instance variable?
A) Get methods
B) Replace methods
C) Assign methods
D) Set methods

Points Earned:
Correct Answer(s):

0.0/0.0
D

18.
In the UML, a classs attributes are placed in the _____ compartment of the classs rectangle.
A) first
B) second
C) third
D) bottom
Points Earned:
Correct Answer(s):

0.0/0.0
B

19.
_____ is invoked to create an object.
A) A constructor
B) The main method
C) A method with a return type
D) A method with the void return type
Points Earned:
Correct Answer(s):

20.
Constructors _____.
A) initialize instance variables
B) when overloaded, can have identical argument lists

0.0/0.0
A

C) when overloaded, are selected by number, types and order of types of parameters
D) a and c
Points Earned:
Correct Answer(s):

0.0/0.0
D

21.
UML _____ model several states of an object and show under what circumstances the object
changes state.
A) diagrams
B) activity diagrams
C) state machine diagrams
D) machine diagrams
Points Earned:
Correct Answer(s):

0.0/0.0
C

22.
Which of the following is the superclass constructor call syntax?
A) keyword super, followed by a dot (.)
B) keyword super, followed by a set of parentheses containing the superclass constructor
arguments
C) keyword super, followed by a dot and the superclass constructor name
D) none of the above
Points Earned:
Correct Answer(s):

23.
The static method _____ of class String returns a formatted String.

0.0/0.0
B

A) printf
B) format
C) formatString
D) toFormatString
Points Earned:
Correct Answer(s):

0.0/0.0
B

24.
If the catch-or-declare requirement for a checked exception is not satisfied _____.
A) the compiler will issue an error message indicating that the exception must be caught
B) the compiler will issue an error message indicating that the exception must be caught or
declared
C) a stack trace will be displayed indicating the exception that has occurred and where it
occurred
D) a stack trace will be displayed, along with a message indicating that the exception must
be caught
Points Earned:
Correct Answer(s):

0.0/0.0
B

25.
Private fields of a superclass can be accessed in a subclass _____.
A) by calling private methods declared in the superclass
B) by calling public or protected methods declared in the superclass
C) directly
D) all of the above
Points Earned:
Correct Answer(s):

0.0/0.0
B

26.
What is the default initial value of a String instance variable?
A) ""
B) "default"
C) default
D) null
Points Earned:
Correct Answer(s):

0.0/0.0
D

27.
A constructor cannot _____.
A) be overloaded
B) initialize variables to their defaults
C) specify return types or return values
D) have the same name as the class
Points Earned:
Correct Answer(s):

0.0/0.0
C

28.
What is best to describe the relationship between a container and a layout manager?
A) association
B) aggregation
C) composition
D) inheritance
Points Earned:
Correct Answer(s):

0.0/0.0
B

29.
Polymorphism enables you to
A) program in the general
B) program in the specific
C) absorb attributes and behavior from previous classes
D) hide information from the user
Points Earned:
Correct Answer(s):

0.0/0.0
A

30.
Sending a message to an object means that _____.
A) you call a method of the object
B) you access a variable of the object
C) both (a) and (b)
D) neither (a) nor (b)
Points Earned:
Correct Answer(s):

0.0/0.0
A

31.
What does the equals() method in the Object class return?
A) a boolean indicating whether some other object is equal to this one
B) a zero indicating that the objects are equal
C) an int indicating whether some other object is equal to this one
D) throws an exception indicating that the objects are not equal
Points Earned:
Correct Answer(s):

0.0/0.0
A

32.
What is the default initial value of a String instance variable?
A) ""
B) "default"
C) default
D) null
Points Earned:
Correct Answer(s):

0.0/0.0
D

33.
A default constructor has how many parameters?
A) 0
B) 1
C) 2
D) variable
Points Earned:
Correct Answer(s):

0.0/0.0
A

34.
When a subclass constructor calls its superclass constructor, what happens if the superclasss
constructor does not assign a value to an instance variable?
A) A syntax error occurs.
B) A compile-time error occurs.
C) A run-time error occurs.
D) The program compiles and runs because the instance variables are initialized to their
default values.
Points Earned:

0.0/0.0

Correct Answer(s):

35.
Method getFont of class Graphics returns _____.
A) the current font name as a string
B) the font size in points
C) a Graphics object representing the current font
D) a Font object representing the current font
Points Earned:
Correct Answer(s):

0.0/0.0
D

36.
The default layout out of a JPanel is _____.
A) FlowLayout
B) GridLayout
C) BorderLayout
D) none
Points Earned:
Correct Answer(s):

0.0/0.0
A

37.
It is a UML convention to denote the name of an abstract class in _____.
A) bold
B) italics
C) a diamond

D) There is no convention of the UML to denote abstract classesthey are listed just as any
other class.
Points Earned:
Correct Answer(s):

0.0/0.0
B

38.
Attributes of a class are also known as _____.
A) constructors
B) local variables
C) fields
D) classes
Points Earned:
Correct Answer(s):

0.0/0.0
C

39.
To add a component c to a JPanel p, use _____.
A) p.add(c)
B) p.getContentPane(c)
C) p.insert(c)
D) p.append(c)

Points Earned:
Correct Answer(s):

0.0/0.0
A

40.
A programmer-defined constructor that has no arguments is called a _____.

A) zero-argument constructor
B) no-argument constructor
C) default constructor
D) main constructor
Points Earned:
Correct Answer(s):

0.0/0.0
B

41.
In the UML, the
diagram emphasizes which objects participate in collaborations.
A) participation
B) communication
C) collaboration
D) sequence

Points Earned:
Correct Answer(s):

0.0/0.0
B

42.
Which statement is false?
A) The actual data representation used within the class is of no concern to the classs clients.
B) Clients generally care about what the class does but not how the class does it.
C) Clients are usually involved in a classs implementation.
D) Hiding the implementation reduces the possibility that clients will become dependent on
class-implementation details.
Points Earned:
Correct Answer(s):

0.0/0.0
C

43.
If no exception occurs in a try-catch block, the code in the finally clause _____.
A) is not executed
B) is ignored.
C) is executed
D) may be executed
Points Earned:
Correct Answer(s):

0.0/0.0
C

44.
An object is an instance of a _____.
A) program
B) class
C) method
D) data
Points Earned:
Correct Answer(s):

0.0/0.0
B

45.
The throws clause of a method _____.
A) specifies the exceptions a method catches
B) specifies the exceptions thrown by the calling method
C) specifies the exceptions a method throws
D) specifies the exceptions a method throws and catches
Points Earned:
Correct Answer(s):

0.0/0.0
C

46.
Which statement is false?
A) The actual data representation used within the class is of no concern to the classs clients.
B) Clients generally care about what the class does but not how the class does it.
C) Clients are usually involved in a classs implementation.
D) Hiding the implementation reduces the possibility that clients will become dependent on
class-implementation details.
Points Earned:
Correct Answer(s):

0.0/0.0
C

47.
A Java exception is an instance of _____.
A) RuntimeException
B) Exception
C) Error
D) Throwable.

Points Earned:
Correct Answer(s):

0.0/0.0
D

48.
Exceptions can be thrown by _____.
A) the Java Virtual Machine
B) code in a try block
C) calls from a try block to other methods
D) all of the above
Points Earned:

0.0/0.0

Correct Answer(s):

49.
A JLabel can be attached to a JFrame using method _____.
A) attach
B) contain
C) append
D) add
Points Earned:
Correct Answer(s):

0.0/0.0
D

50.
If an exception occurs in a try-catch block, the code in the finally clause _____.
A) is not executed
B) is not executed if the exception is caught.
C) is executed
D) may be executed
Points Earned:
Correct Answer(s):

0.0/0.0
C

También podría gustarte