SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Object Oriented Programming
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. We use an object when we have a _________ to it
called method
reference
the DecimalFormat class
instance data
2. Each piece of data that we send to a method
parameter
import java.util*
encapsulation
local data
3. Occurs when a value of one type is assigned to a variable of another type during which the value is converted to the new type.
Scanner scan=new Scanner (System.in);
assignment conversion
accessor method
inheritance
4. Defined and then used as the type of a variable when it is declared; establishes all possible values of a variable of that type by listing - or enumerating - them.
tokens
reference
enumerated type
reserved word void
5. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
floating point numbers
promotion
String toLowerCase ( )
reference
6. A class usually provides services to access and modify __________
uninitialized variables
data values
variable
postfix form
7. Instructs the compiler to reserve a portion of main memory space large enough to hold a particular type of value and indicates the name by which we refer to that location
variable declaration
Scanner class
conditionals
encapsulation of an object
8. Represents either a primitive value or an object
variable name
String format (double number)
java.lang package
parentheses
9. After an object has been instantiated - we set the _________ to access its methods
dot operator
char charAt (int index)
primitive variables
character literal
10. In the header of a method specifies he types of the values that are passed and the names by which the called method will refer to those values.
parameter list
String concat (String str)
Scanner class
static
11. An explicit data value used in a program
constants
conditionals
literal
inheritance
12. A value that is passed into a method when it is invoked
parameter
pointer
assignment statement
constructors
13. The names of the parameters in the header of the method declaration
formal parameters
primitive variables
the DecimalFormat class
encapsulation of an object
14. The Scanner class is part of ___________________
string name;
String (String str)
literal
java.util class libary
15. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
declared
literal
encapsulation of an object
16. A ____________ and definition always give the parameter list in parentheses after the method name. if there are no parameters - an empty set of parentheses is used
encapsulation
Scanner useDelimiter(String pattern)
prefix form
method invocation
17. Constructors do not even _______; therefore they cannot return a value.
have void
initialize
flow of control
uninitialized variables
18. Return type specified in the method header can be a primitive type - class name or the ________; when a method does not return any value - void is used as the return type - as is always done with the main method.
initialize
reserved word void
underscores
pointer
19. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
boolean equalsIgnoreCase (String str)
attributes of an object
encapsulation
boolean value
20. Begins with a backslash character ""
escape sequences
variable name
pointer
String concat (String str)
21. Instance data should be defined with what________ visibility
operations
num=Integer.parseInt(str);
private
instance variable
22. A Java operator that is specified by a type name in parentheses; truncates rather than rounds; useful in division if u want an integer to be treated as a float or double
java.lang package
casting
Scanner useDelimiter(String pattern)
flow of control
23. sides=10;
assignment statement
autoboxing
signed
inheritance
24. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
tokens
inheritance
dot operator
NumberFormat class
25. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
String replace (char oldChar - char newChar)
floating point numbers
import java.util*
scope
26. How classes are created from other classes. the definition of one class can be based on another class that already exists. inheritance is a form of software reuse - capitalizing on the similarities between various kinds of classes that we want to cre
delimiters
RH
inheritance
visibility modifiers
27. A ________________ is immutable.
static
String object
Random class
parentheses
28. Declared in a class but not inside any particular method
instance data
floating point numbers
class
actual parameters
29. ____________ is instantiated in the traditional way using the new operator.
java.util class libary
Understanding
the DecimalFormat class
conditionals
30. Five steps of problem-solving: ____________ the problem - Designing a solution - Considering alternatives to the solution and refining the solution - Implementing the solution - Testing the solution and fixing any problems that exist
reference
constructors
Understanding
delimiters
31. Constants are ______ because the can't be changed once you use the final modifier
inheritance
instance variable
public
NumberFormat class
32. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
service methods
behaviors of an object
boolean equals (String str)
String next( )
33. All numeric types are _______ - meaning both positive and negative values can be stored in them
boolean hasNext( )
constructors
String replace (char oldChar - char newChar)
signed
34. A group of programming statements that is given a name. when a method is invoked - its statements are executed. a set of methods is associated with an object and defines its potential behaviors. to define the ability to make a deposit into a bank acc
boolean value
method
String toLowerCase ( )
primitive variables
35. The values passed into a method in an invocation; these are called the arguments to the method
declared
assignment statement
actual parameters
Scanner useDelimiter(String pattern)
36. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
assignment statement
mutator method
Understanding
37. Four integer data types: byte - short - int - _____
assignment statement
java.util class libary
String substring (int offset - int endIndex)
long
38. This declaration creates a Scanner object that reads input from the keyboard
boolean value
parameter
Scanner scan=new Scanner (System.in);
String next( )
39. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
public
boolean nextBoolean( )
num=Integer.parseInt(str);
String toUpperCase ( )
40. An object in Java - defined by the class String
character string
arithmetic
constants
class library
41. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
java.util class libary
encapsulation
String replace (char oldChar - char newChar)
42. Three ways in which Java conversions occur: _________ conversion - promotion - casting
java.lang package
assignment
self-governing
parameter list
43. If the string object str holds the string "987" - the following line of code converts the string into the integer variable 987 and stores that value in the int variable num:
java.lang package
declared
num=Integer.parseInt(str);
accessor method
44. Returns true if the scanner has anotehr token in its input.
private
boolean hasNext( )
prefix form
pointer
45. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
primitive variables
the DecimalFormat class
parentheses
wrapper class
46. The location at which a variable is declared defines its scope - which is the area within a program in which the variable can be referenced.
System.out.println
scope
inheritance
String nextLine( )
47. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
String substring (int offset - int endIndex)
Random class
header of a method
import java.util*
48. declaration that creates a String variable that holds a reference to a String object; an object variable doesn't hold an object itself - it holds the address of an object
string name;
long
java.lang package
string literal
49. Also called a selection statement b/c it allows us to choose which statement will be executed next.
public
formal parameters
conditional statement
parameter list
50. Variables and constants can be referenced in any method of the class by declaring at the _________
Scanner class
String format (double number)
class level
assignment