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. ____________ is instantiated in the traditional way using the new operator.
public
postfix form
tokens
the DecimalFormat class
2. They clarify the role a certain number has in the program.
constants
RH
set
visibility modifiers
3. 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
NumberFormat class
header of a method
System.out.println
instantiation
4. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
support methods
constructors
String object
parameter list
5. Returns a string containing the specified number formatted according to this object's pattern.
String object
num=Integer.parseInt(str);
conditional statement
String format (double number)
6. Protection and management of an object's info. this implies that the object should be self-governing. the only changes made to the state of the object should be accomplished by that object's methods. other objects should not be able to "reach in" to
String substring (int offset - int endIndex)
import java.util*
enumerated type
encapsulation of an object
7. Cast operator has _________ precedence to division
return statement
String object
higher
char charAt (int index)
8. A class usually provides services to access and modify __________
inheritance
tokens
scope
data values
9. Represents either a primitive value or an object
long
class level
variable name
reserved word void
10. Returns the number of characters in this stirng.
byte to short
private
int length( )
string name;
11. Constructors do not even _______; therefore they cannot return a value.
assignment statement
have void
actual parameters
enumerated type
12. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
reference
NumberFormat class
state of an object
scope
13. Declared in a class but not inside any particular method
autoboxing
higher
instance data
method declaration
14. Variables and constants can be referenced in any method of the class by declaring at the _________
mutator method
class level
int compareTo (String str)
Understanding
15. The act of creating an object using the "new" operator
instantiation
boolean equalsIgnoreCase (String str)
Random class
dot operator
16. Begins with a backslash character ""
escape sequences
operations
character string
public
17. 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.
boolean hasNext( )
signed
assignment conversion
encapsulation of an object
18. 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);
promotion
static
Understanding
19. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
Scanner useDelimiter(String pattern)
operations
escape sequences
service methods
20. When a variable is declared inside a method
variable
local data
RH
packages
21. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
String toUpperCase ( )
method declaration
import java.util*
assignment
22. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
String findInLine (String pattern)
support methods
Scanner useDelimiter(String pattern)
String format (double number)
23. A variable that refers to an object must be __________
String format (double number)
declared
variable declaration
String concat (String str)
24. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
String replace (char oldChar - char newChar)
not possible
return statement
promotion
25. 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.
literal
encapsulation
have void
parameter
26. A ________________ is immutable.
reserved word void
String object
assignment statement
postfix form
27. Each piece of data that we send to a method
promotion
conditional statement
reserved word void
parameter
28. 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.
reserved word void
byte to short
instance variable
visibility modifiers
29. Two floating data types: float - _______
null
double
boolean hasNext( )
packages
30. All wrapper classes are defined in ___________
method
literal
java.lang package
encapsulation
31. Returns all input remaining on the current line as a character string.
String concat (String str)
service methods
String nextLine( )
higher
32. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
assignment statement
self-governing
parentheses
instantiation
33. Expressed in a Java program with single quotes
character literal
declared
promotion
called method
34. Constructor: creates a new string object with the same characters as str.
import java.util*
String (String str)
uninitialized variables
Scanner scan=new Scanner (System.in);
35. Modifier>type/void>identifier>parameters>method body
method declaration
wrapper class
conditionals
character string
36. Two categories of statements that control the flow of executing through a method: __________ and loops
floating point numbers
conditionals
assignment conversion
int compareTo (String str)
37. Constants are ______ because the can't be changed once you use the final modifier
int compareTo (String str)
boolean equals (String str)
casting
public
38. Returns a new string consisting of this string concatenated with str.
character literal
instantiation
String concat (String str)
promotion
39. ++count; -- count
String toUpperCase ( )
prefix form
arithmetic
byte nextByte( )
40. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
not possible
conditional statement
floating point numbers
boolean equalsIgnoreCase (String str)
41. 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
behaviors of an object
Random ( )
instance data
Understanding
42. Count++; count--
String object
parameter
String concat (String str)
postfix form
43. Provide various methods related to the management of the associated primitive type. Used when we create an object that serves as a container to hold various types of other objects - and we want the object to hold a simple integer value. In this case
instance variable
wrapper class
mutator method
java.lang package
44. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
String toUpperCase ( )
string literal
accessor method
called method
45. This declaration creates a Scanner object that reads input from the keyboard
delimiters
RH
string literal
Scanner scan=new Scanner (System.in);
46. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
parentheses
casting
byte to short
pointer
47. A null reference indicates that a variable does not refer to an object
static int parseInt (String str)
null
boolean equalsIgnoreCase (String str)
long
48. 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
int length( )
Scanner scan=new Scanner (System.in);
higher
49. The Scanner class is part of ___________________
java.util class libary
null
assignment
assignment statement
50. The classes of the Java standard class library are grouped into __________.
encapsulation
delimiters
method
packages