Quiz
Java (Multimedia Approach) Ch 6,7,9
Crie uma conta grátis para terminar este quiz
Salve seu progresso e veja sua nota final.
Já tem uma conta? Inicie sessão
Perguntas do quiz (38)
1The name of the method and the data types of the method's return type and the types of its parameters is described as the method's signature.
- AVerdadeiro
- BFalso
2A class inherits the constructors of its superclass.
- AVerdadeiro
- BFalso
3In Java, it is not possible to create an object instance of an abstract class.
- AVerdadeiro
- BFalso
4If I wish to create a variable FICA which has the value 0.062 and the value of the variable is not allowed to change, we can declare it as ____________.
- Aprivate double FICA = 0.062;
- Bfinal double FICA = 0.062;
- Cpublic double FICA = 0.062;
- Dprotected double FICA = 0.062;
- Econst double FICA = 0.062;
5If a class is created primarily to create subclasses, it should be declared as ____________.
- Asuper
- B final
- Cprivate
- Doverload
- E abstract
6A subclass of an abstract class must implement all abstract methods in its parent class.
- AVerdadeiro
- BFalso
7True or False? Final methods can be overloaded.
- AVerdadeiro
- BFalso
8Allowing an object to select to select a particular behavior is best associated with ________.
- Aoverloading a method
- Bmultilevel inheritance
- Chierarchical inheritence
- Doverriding a method
- Epolymorphism
9In order for a object of a subclass type to access the superclass' variables directly, the variables must be declared as _______.
- A private, public, or protected
- Bprotected
- Cprivate
- Dpublic or protected - but not private
- Epublic
10True or False? A panel can contain other panels.
- AVerdadeiro
- BFalso
11True or False? The FlowLayout class can be used to create a layout in which all components are placed in a single column within the container.
- AVerdadeiro
- BFalso
12The content pane is obtained using the getContentPane method of the ______ class.
- AJPanel
- BJButton
- CJFrame
- DJComponent
- EJayZ
13In order to get a row of buttons, one can use the ______ layout manager.
- ABorderLayout
- BFlowLayout
- CBoxLayout
- DGridLayout
- ELayabout
14When a user clicks on a push button on the GUI it generates an ActionEvent.
- AVerdadeiro
- BFalso
15The setBackground method is a method of the JFrame class.
- AVerdadeiro
- BFalso
16It is possible to create Border objects for a panel by using the _______ class.
- ABorderFactory
- BBorderLayout
- CGridLayout
- Dnone of these
- EGrid
17Before events can be captured it is necessary to add a/an ______ to the component.
- A ActionCommand
- Bmouse object
- CActionListener
- Dnone of these
- Egraphics object
18Within a set of check buttons representing options, only one can be selected.
- AVerdadeiro
- BFalso
19The JFileChooser() class is an example of a class which can generate a dialog.
- AVerdadeiro
- BFalso
20To create a Java program that uses a GUI interface, which of the following must be done?
- Aall of these
- Bimplement listener classes
- Cestablish relationships between the listeners and the components
- Dcreate and set up components
- Enone of these
21Which of the following method will retrieve the text displayed on a object of the JButton class?
- Anone of these
- BgetValue
- CgetText()
- Dall of these
- EgetActionCommand()
22Within a set of check buttons representing options, only one can be selected.
- AVerdadeiro
- BFalso
23True or False? The size of an array can be printed out using the length method.
- AVerdadeiro
- BFalso
24The JSlider class fires a ________ event when it is manipulated.
- AActionEvent
- BItemEvent
- CNone of these
- DChangeEvent
- EClickEvent
25Which of the following statements creating an array is valid?
- A int[] array = new int(10);
- Bint[] array = new int[10];
- Carray = {10, 20, 40};
- Dint array = new int[10];
26True or False? An existing array can be populated with an initializer list.
- AVerdadeiro
- BFalso
27True or False? Arrays of only primitive types, and not reference types, can be sorted using the sort method in the java.util.Arrays class.
- AVerdadeiro
- BFalso
28What is the output of the following program?
public enum Planets {
MERCURY,
EARTH,
MARS,
JUPITER;
public static void main(String[] args) {
Planets planet;
planet = MARS;
System.out.println(planet.ordinal());
}
}- A1
- B2
- C3
- D4
29True or False? An existing array can be populated with an initializer list.
- AVerdadeiro
- BFalso
30True or False? Arrays of only primitive types, and not reference types, can be sorted using the sort method in the java.util.Arrays class.
- AVerdadeiro
- BFalso
31True or False? It is not possible to create an object of an enum using the new operator.
- AVerdadeiro
- BFalso
32True or False? If I have an array
char[] charArr = {'J','a','v','a'};
I can convert it to a string by using the following constructor:
String str1 = new String(charArr);- AVerdadeiro
- BFalso
33Which of the following structures would be best to use if we wish to store information about a chess board?
- Aan ArrayList
- Ba two-dimensional array
- Ca Point
- Dan enum
34Suppose I have an ArrayList declared as follows:
ArrayList list = new ArrayList();
I wish to print out the number of elements in list. Which statement would do this?- ASystem.out.println(list.size);
- BSystem.out.println(list.size());
- CSystem.out.println(list.length());
- Dany of these
- ESystem.out.println(list.length);
35Suppose I have the following Strings:
String s1 = "A string";
String s2 = new String("A string");
String s3 = new String("A string");
which of the following comparisons will yield a true?- Anone of these will be true.
- Bs2 == s3
- C s1 == s3
- D s1 == s2
- Eall of these will be true
36True or False? It is possible to change the size of an ArrayList object at run time by using the .add method.
- AVerdadeiro
- BFalso
37True or False? To find out how many elements there are in an ArrayList use the size() method.
- AVerdadeiro
- BFalso
38In order to check to see that two String objects contain the same string (the same characters in the same order) it is best to _______.
- Anone of these.
- Bcompare using the substring method.
- Cuse the length() method to compare the sizes of both strings.
- Duse the .equals method
- Ecompare them with the == operator.
Informações
- Descrição
- C2 Java Programming Quiz sobre Java (Multimedia Approach) Ch 6,7,9, criado por johnrclark12 em 07-11-2014.
- Autor
- johnrclark12
- Idioma
- English
- Visualizações
- 14
- Etiquetas
- Avaliação
- Ainda sem avaliações Avalie este quiz