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. 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.
signed
enumerated type
instance variable
RH
2. 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
method declaration
pointer
long
parameter
3. Expressed in a Java program with single quotes
accessor method
self-governing
character literal
data values
4. A variable that refers to an object must be __________
literal
declared
aliases
Scanner useDelimiter(String pattern)
5. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
primitive variables
behaviors of an object
operations
instance variable
6. Begins with a backslash character ""
actual parameters
escape sequences
assignment statement
public
7. A value that is passed into a method when it is invoked
instance variable
arithmetic
parameter
Scanner class
8. When a variable is declared inside a method
local data
String toUpperCase ( )
service methods
string name;
9. Returns the next input token as a character string.
instance data
String findInLine (String pattern)
autoboxing
String next( )
10. Returns all input remaining on the current line as a character string.
reference
String nextLine( )
String replace (char oldChar - char newChar)
arithmetic
11. Returns a new string consisting of this string concatenated with str.
System.out.println
assignment conversion
boolean equals (String str)
String concat (String str)
12. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
constants
String concat (String str)
accessor method
Understanding
13. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
casting
long
primitive variables
14. 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
expression
Scanner class
higher
Understanding
15. The values passed into a method in an invocation; these are called the arguments to the method
actual parameters
class
mutator method
NumberFormat class
16. 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 name;
encapsulation of an object
declared
method
17. An object has behaviors - which are defined by the ________ associated with that object.
return statement
boolean equals (String str)
operations
method invocation
18. Returns the next input token as the indicated type.
declared
boolean nextBoolean( )
conditionals
prefix form
19. Returns the int corresponding to the value stored in the specified string
accessor method
state of an object
static int parseInt (String str)
instance data
20. The act of creating an object using the "new" operator
signed
escape sequences
instantiation
visibility modifiers
21. 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
double
num=Integer.parseInt(str);
inheritance
casting
22. sides=10;
assignment statement
String toLowerCase ( )
tokens
packages
23. Delimited by double quotation characters
support methods
character literal
byte to short
string literal
24. ______________ operators have higher precedence
arithmetic
literal
java.util class libary
String (String str)
25. Boolean type conversions are ___________
not possible
constructors
inheritance
conditionals
26. The Scanner class is part of ___________________
have void
System.out.println
parameter list
java.util class libary
27. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
inheritance
Scanner class
method
int compareTo (String str)
28. 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
Random ( )
String substring (int offset - int endIndex)
dot operator
inheritance
29. Cast operator has _________ precedence to division
have void
aliases
Random class
higher
30. After an object has been instantiated - we set the _________ to access its methods
initialize
private
visibility modifiers
dot operator
31. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
long
variable declaration
promotion
String toUpperCase ( )
32. Changes a particular value - e.g.setX - where X is the value they are setting.
string name;
self-governing
String concat (String str)
mutator method
33. The order in which statements are executed in a running program
flow of control
double
local data
boolean equals (String str)
34. Modifier>type/void>identifier>parameters>method body
self-governing
higher
import java.util*
method declaration
35. 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.
promotion
parameter list
assignment statement
public
36. All wrapper classes are defined in ___________
floating point numbers
class level
parentheses
java.lang package
37. The declarations of object variables have a similar structure to the declaration of _______________
boolean nextBoolean( )
primitive variables
variable
the "import" declaration
38. Returns true if the scanner has anotehr token in its input.
character string
Understanding
boolean hasNext( )
class
39. White space characters such as space characters - tabs - and new lines that separate the elements of input
boolean nextBoolean( )
Random class
delimiters
return statement
40. Instance data should be defined with what________ visibility
String next( )
private
literal
uninitialized variables
41. Count++; count--
underscores
data values
assignment conversion
postfix form
42. This declaration creates a Scanner object that reads input from the keyboard
boolean value
char charAt (int index)
Scanner scan=new Scanner (System.in);
Random class
43. A method that returns a value must have a _________
return statement
variable
import java.util*
parentheses
44. Constructor: creates a new pseudorandom number generator.
service methods
reserved word void
class
Random ( )
45. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
boolean equalsIgnoreCase (String str)
declared
called method
constructors
46. 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:
method
visibility modifiers
num=Integer.parseInt(str);
String toUpperCase ( )
47. Two floating data types: float - _______
boolean equals (String str)
instance variable
double
inheritance
48. 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
static
String toUpperCase ( )
wrapper class
static int parseInt (String str)
49. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
assignment conversion
service methods
initialize
NumberFormat class
50. A class usually provides services to access and modify __________
Scanner useDelimiter(String pattern)
data values
Scanner scan=new Scanner (System.in);
int compareTo (String str)