SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
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. A variable that refers to an object must be __________
class
parameter
declared
String toUpperCase ( )
2. Returns a new string consisting of this string concatenated with str.
String concat (String str)
constants
parameter
visibility modifiers
3. Returns all input remaining on the current line as a character string.
String (String str)
String nextLine( )
java.lang package
null
4. New memory space is reserved for that variable every time an instance of the class that is created.
Scanner useDelimiter(String pattern)
boolean equals (String str)
instance data
the "import" declaration
5. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
mutator method
String object
have void
service methods
6. 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:
num=Integer.parseInt(str);
RH
wrapper class
the DecimalFormat class
7. The declarations of object variables have a similar structure to the declaration of _______________
static int parseInt (String str)
mutator method
primitive variables
casting
8. Every object has two things: a state and a _____ of behaviors
String format (double number)
return statement
set
Scanner scan=new Scanner (System.in);
9. 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
inheritance
String toLowerCase ( )
public
flow of control
10. Sets the scanner's delimiting pattern.
variable declaration
Scanner useDelimiter(String pattern)
string name;
delimiters
11. Variables and constants can be referenced in any method of the class by declaring at the _________
NumberFormat class
int compareTo (String str)
a constructor
class level
12. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
accessor method
assignment statement
string literal
13. Constructor: creates a new string object with the same characters as str.
RH
String (String str)
variable declaration
state of an object
14. format for constants: all upper-case; separated by ________
Understanding
inheritance
underscores
data values
15. Delimited by double quotation characters
aliases
string literal
num=Integer.parseInt(str);
variable name
16. Making it difficult - if not impossible - for code outside of a class to "reach in" and chnage the value of a variable that is declared inside that class.
variable
encapsulation
self-governing
RH
17. The one that is invoked
String nextLine( )
called method
mutator method
parameter list
18. Two floating data types: float - _______
primitive variables
double
declared
import java.util*
19. Constants are ______ because the can't be changed once you use the final modifier
tokens
public
floating point numbers
String toUpperCase ( )
20. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
parentheses
casting
String findInLine (String pattern)
parameter
21. 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.
method
String next( )
scope
not possible
22. Methods in the Math class are ______
method invocation
static
encapsulation of an object
String concat (String str)
23. Control access to the members of a class. the reserved words public and private are visibility modifiers that can be applied to the variables and methods of a class.
method
higher
character string
visibility modifiers
24. After an object has been instantiated - we set the _________ to access its methods
String replace (char oldChar - char newChar)
dot operator
the "import" declaration
instance variable
25. When two variables contain the same address and therefore refer to the same object; one important implication of _________ is that when we use one ref to change an object - it is also changed for the other reference because there is really only one o
conditional statement
null
formal parameters
aliases
26. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
enumerated type
String toLowerCase ( )
state of an object
double
27. This declaration creates a Scanner object that reads input from the keyboard
String (String str)
the "import" declaration
Scanner scan=new Scanner (System.in);
parentheses
28. A value that is passed into a method when it is invoked
assignment conversion
character literal
parameter
long
29. System.out object represents an output device or file; we send the println message to the System.out object to request that some text be printed
literal
String nextLine( )
char charAt (int index)
System.out.println
30. ____________ is instantiated in the traditional way using the new operator.
tokens
reserved word void
enumerated type
the DecimalFormat class
31. Since an object ref var holds the address of the object - it can be thought of as a ____ to the location in memory where the object is held
int length( )
Random ( )
pointer
a constructor
32. The values passed into a method in an invocation; these are called the arguments to the method
encapsulation
actual parameters
String replace (char oldChar - char newChar)
delimiters
33. Declared in a class but not inside any particular method
null
instance data
int length( )
String toUpperCase ( )
34. Returns the number of characters in this stirng.
string name;
int length( )
reserved word void
local data
35. A method that returns a value must have a _________
boolean hasNext( )
local data
return statement
visibility modifiers
36. Count++; count--
arithmetic
Scanner scan=new Scanner (System.in);
postfix form
constructors
37. 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 object
string name;
constants
String (String str)
38. Represents either a primitive value or an object
aliases
have void
enumerated type
variable name
39. 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.
char charAt (int index)
parameter list
Random class
String concat (String str)
40. An explicit data value used in a program
assignment conversion
null
boolean equals (String str)
literal
41. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
String object
class level
state of an object
behaviors of an object
42. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
have void
boolean nextBoolean( )
String nextLine( )
java.lang package
43. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
String toUpperCase ( )
behaviors of an object
support methods
num=Integer.parseInt(str);
44. A combo of one or more operators and operands that usually perform a calculation; operands can be literals - constants - variables - or other sources of data
String substring (int offset - int endIndex)
expression
class level
wrapper class
45. 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
method invocation
variable declaration
postfix form
casting
46. Also called a selection statement b/c it allows us to choose which statement will be executed next.
private
conditional statement
escape sequences
NumberFormat class
47. 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
operations
actual parameters
conditional statement
Understanding
48. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
java.util class libary
Understanding
import java.util*
Random class
49. Variables that don't contain any data
uninitialized variables
java.lang package
enumerated type
import java.util*
50. A special method that has the same name as the class. After the "new" operator creates the object it is invoked to help set it up initially
class level
a constructor
method invocation
instantiation