This Is A Collection of Programming Statements That Specify The Fields and Methods That A Particular Type of Object May Have
This Is A Collection of Programming Statements That Specify The Fields and Methods That A Particular Type of Object May Have
a. String
b. Char
c. Character
d. StringBuilder
c. Character
This method converts a character to uppercase.
a. makeUpperCase
b. toUpperCase
c. isUpperCase
d. upperCase
b. toUpperCase
The startsWith , endsWith , and regionMatches methods are members of this
class.
a. String
b. Char
c. Character
d. Wrapper
a. String
The indexOf and lastIndexOf methods are members of this class.
a. String
b. Integer
c. Character
d. Wrapper
a. String
The substring , getChars , and toCharArray methods are members of this
class.
a. String
b. Float
c. Character
d. Wrapper
a. String
This String class method performs the same operation as the + operator when
used on strings.
a. add
b. join
c. concat
d. plus
c. concat
The String class has several overloaded versions of a method that accepts a
value of any primitive data type as its argument and returns a string
representation of the value. The name of the method is ___________.
a. stringValue
b. valueOf
c. getString
d. valToString
b. valueOf
If you do not pass an argument to the StringBuilder constructor, the object will
have enough memory to store this many characters.
a. 16
b. 1
c. 256
d. Unlimited
a. 16
This is one of the methods that are common to both the String and
StringBuilder classes.
a. append
b. insert
c. delete
d. length
d. length
To change the value of a specific character in a StringBuilder object, use this
method.
a. changeCharAt
b. setCharAt
c. setChar
d. change
b. setCharAt
To delete a specific character in a StringBuilder object, use this method.
a. deleteCharAt
b. removeCharAt
c. removeChar
d. expunge
a. deleteCharAt
The character that separates tokens in a string is known as a __________.
a. separator
b. tokenizer
c. delimiter
d. terminator
c. delimiter
This String method breaks a string into tokens.
a. break
b. tokenize
c. getTokens
d. split
d. split
These static final variables are members of the numeric wrapper classes and
hold the minimum and maximum values for a particular data type.
a. subclass
b. superclass
c. derived class
d. child class
b. superclass
2. In an inheritance relationship, this is the specialized class.
a. superclass
b. base class
c. subclass
d. parent class
c. subclass
3. This key word indicates that a class inherits from another class.
a. derived
b. specialized
c. based
d. extends
d. extends
4. In a subclass does not have access to these superclass member
...
5. This key word refers to an object's superclass.
a. super
b. base
c. this
d. parent
super
6. In a subclass constructor, a call to the superclass constructor must
Very first statement
The following is an explicit call to the superclass's default constructor.
a. default();
b. class();
c. super();
d. base();
super()
8. A method in a subclass having the same signature as a method in the
superclass is an
example of
a. overloading
b. overriding
c. composition
d. an error
b. overriding
9. A method in a subclass having the same name as a method in the
superclass but a
different signature, is an example of
a. overloading
b. overriding
c. composition
d. an error
a. overloading
10. These superclass members are accessible to subclasses and classes in
the same packet.
Protected
11. all classes directly or indirectly inherit from this class.
object
12. With this type of binding, the Java Virtual Machine determines at runtime
which
method to call, depending on the type of the object that a variable references.
a. static
b. early
c. flexible
d. dynamic
d. dynamic
13. When a class implements an interface, it must
a. final
b. static
c. both final and static
d. not allowed
c. both final and static
15. Abstract methods must be
a. overridden
b. overloaded
c. deleted and replaced with real methods
d. declared as private
a. overridden
16. Abstract classes cannot
a. be used as superclasses
b. have abstract methods
c. be instantiated
d. have fields
c. be instantiated
17. Constructor are not inherited.
False
18. In a subclass, a call to the superclass constructor can be written only in
the subclass constructor
True
19. True or False: If a subclass constructor does not explicitly call a
superclass constructor,
Java will not call any of the superclass's constructors.
False
20. True or False: An object of a superclass can access members declared in
a subclass.
False
21. True or False: The superclass constructor always executes before the
subclass constructor.
True
22. True or False: When a method is declared with the final modifier, it must
be overridden
in a subclass.
False
23. True or False: A superclass has a member with package access. A class
that is outside
the superclass's package but inherits from the superclass can access this
member.
False
24. a superclass reference variable can reference an object of a class that
inherits from the superclass.
...
25. True or False: A subclass reference variable can reference an object of
the superclass.
True
26. True or False: When a class contains an abstract method, the class
cannot be instantiated.
True
27. True or False: A class can implement only one interface.
False
28. By default all members of an interface are public
False
this type of method does not return a value.
a. null
b. void
c. empty
d. anonymous
b. void
This appears at the beginning of a method definition.
a. semicolon
b. parentheses
c. body
d. header
d. header
The body of a method is enclosed in ________.
a. curly braces {}
b. square brackets []
c. parentheses ()
d. quotation marks ""
a. curly braces {}
a method header can contain __________.
a. method modifiers
b. the method return type
c. the method name
d. a list of parameter declarations
e. all of theses
f. none of these
e. all of these
A value that is passed into a method when it is called is known as a(n)______.
a. parameter
b. argument
c. signal
d. return value
b. argument
a variable that receives a value that is passed into a method is known as a(n) _______.
a. parameter
b. argument
c. signal
d. return value
a. parameter
This javadoc tag is used to document a parameter variable.
a. @parameter
b. @para
c. @paramvar
d. @arg
b. @para
This statement causes a method to end and sends a value back to the statement that
called the method.
a. end
b. send
c. exit
d. return
d. return
this javadoc tag is used to document a method's return value
a. @methodreturn
b. @ret
c. @return
d. @returnval
c. @return
true or false. you terminate a method header with a semicolon.
false
true or false. when passing an argument to a method, java will automatically perform
a widening conversion, if necessary
true
true or false. when passing an argument to a method, java will automatically perform
a narrowing conversion when necessary.
false
true or false. a parameter variable's scope is the entire program that contains the
method in which the parameter is declared
false
true or false. when code in a method changes the value of a parameter, it also changes
the value of the argument that was passed into the parameter.
false
true or false. when an object, such as String, is passed as an argument, it is actually a
reference to the object that is passed.
true
true or false. the contents of a string object cannot be changed
true
true or false. when passing multiple arguments to a method, the order in which the
arguments are passed is not important.
false
true or false. no two methods in the same program can have a local variable with the
same name.
false
true or false. it is possible for one method to access a local variable that is declared in
another method.
false
true or false. you must have a return statement in a value-returning method
true