Quiz
Java (Multimedia Approach) Ch 5
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 (35)
1Data values of a class are referred to as fields or attributes.
- AVerdadeiro
- BFalso
2A method can return only one value and the return type of the method must match the data type of the variable being returned.
- AVerdadeiro
- BFalso
3A method that changes the value of one or more of the object's attributes is called a
- Amutator or transformer
- Baccessor or observer
- Citerator
- Dconstructor
- Edestructor
4When we have multiple methods that each have the same name but different number of parameters or type of parameters we have an example of
- Apolymorphism
- Boverloaded methods
- Cambiguous methods
- D none of these
- E a syntax error
5Java uses pass-by-value to pass arguments.
- AVerdadeiro
- BFalso
6Classes can only have one constructor method.
- AVerdadeiro
- BFalso
7In order to refer to the object itself from inside of one of the object's methods it is useful to use the keyword
- Aprivate
- Bpublic
- Cstatic
- Dvoid
- Ethis
8The technique of combining two images to produce a new image is called
- Aconcatenation
- Bkerning
- Cbuffering
- Dcompositing
- Ecreating a package
9Package names should not contain any uppercase characters.
- AVerdadeiro
- BFalso
10The signature of a method comprises of the name of the method and data types of its parameters.
- AVerdadeiro
- BFalso
11In order to have the value of a local variable within a method keep its value between calls on the method it is useful to use the keyword
- Astatic
- Bprivate
- Cthis
- Dvoid
- Epublic
12In general, data items of a class should be specified as ______ so that statements in another class does not have access to them.
- Avoid
- Bstatic
- Cpublic
- Dprivate
- Ethis
13Static fields are shared between all instances of a class.
- AVerdadeiro
- BFalso
14Javadoc comments start with /** and end with */
- AVerdadeiro
- BFalso
15When using the following statement
String someString = String.format("%.3f",10.5678);
the resulting String will hold the value _______- A10.567
- B10.568
- Cnone of these
- D.567
- E.568
16Which of the following Math class methods will square the value of 7?
- Apow(2,7)
- Bsquare(7)
- Cpow(7,2)
- Dsqr(7)
- E7**2
17A static field is a variable in the class that is shared by all objects of that class.
- AVerdadeiro
- BFalso
18The following statements will print out val1 = 10.57.
String s1 = String.format("val1 = %5.2f", 10.5678);
System.out.println(s1);- AVerdadeiro
- BFalso
19In UML, to signify that an item is private, we use the symbol ____
- Anone of these
- B-
- C~
- D#
- E+
20Each class is allowed exactly one constructor method.
- AVerdadeiro
- BFalso
21All drawing that occurs in a graphic application that uses the javax.swing package is performed on an object of the JPanel class.
- AVerdadeiro
- BFalso
22In UML, the character "+" indicates the item is _____.
- Anone of these
- Bdefault
- Cprivate
- Dpublic
- Eprotected
23In order to allow a class variable to be shared by every object instance of the class, it should be declared to be ______.
- Anone of these
- Bprotected
- Cprivate
- Dpublic
- Estatic
24The com.programwithjava.basic.DrawingKit is an example of user defined package.
- AVerdadeiro
- BFalso
25The parent class can use all methods defined in the child class.
- AVerdadeiro
- BFalso
26Which of the following is correct?
- AAll variables in the derived class need to be re-declared.
- BThe derived class contains methods of the base class but they need to be modified.
- Cnone of these
- DThe derived class inherits only variables of the base class.
- EThe derived class contains the variables and methods of the base class
27In order to create a subclass it is necessary to use the keyword ______
- Aextends
- Binherit
- Cchild
- Doverride
- Esuper
28In UML, to signify that an item is package-private (default), we use the symbol ____.
- A+
- Bnone of these
- C~
- D-
- E#
29Allowing an object to select to select a particular behavior is best associated with ________.
- Ahierarchical inheritence
- Bpolymorphism
- Coverriding a method
- Doverloading a method
- Emultilevel inheritance
30When a object is created, Java automatically calls the superclass constructor for it.
- AVerdadeiro
- BFalso
31Suppose that I have a method for the class Student called Greet().
Student is a a subclass of Person - it also has a Greet() method with the same signature.
I wish to call upon the Person class version of the Greet method. How do I do this?- AGreet().super;
- BGreet().Person;
- Csuper.Greet();
- DGreet();
- EPerson.Greet();
32The following program
class Superclass {
public void foo() {
System.out.print("In Superclass method");
}
}
class Subclass extends Superclass {
public void foo() {
System.out.print("In Subclass method");
}
public static void main(String[] args) {
Superclass obj = new Subclass();
obj.foo();
}
}- Aresults in a runtime error.
- B results in a compilation error.
- Cdisplays the output “In Subclass method”.
- Ddisplays the output “In Superclass method”
33Java uses pass-by-value to pass arguments to methods.
- AVerdadeiro
- BFalso
34A constructor must have at least one parameter.
- AVerdadeiro
- BFalso
35All Java classes are derived, directly or indirectly, from
- A the Java class
- Bthe Object class
- Cthe Parent class
- Dthe Main class
- Ethe sub class
Informações
- Descrição
- C2 Java Programming Quiz sobre Java (Multimedia Approach) Ch 5, criado por johnrclark12 em 10-10-2014.
- Autor
- johnrclark12
- Idioma
- English
- Visualizações
- 8
- Etiquetas
- Avaliação
- Ainda sem avaliações Avalie este quiz