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. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
variable declaration
literal
String format (double number)
self-governing
2. ____________ is instantiated in the traditional way using the new operator.
encapsulation of an object
the DecimalFormat class
java.lang package
boolean nextBoolean( )
3. Begins with a backslash character ""
packages
escape sequences
int length( )
num=Integer.parseInt(str);
4. When a variable is declared inside a method
class level
local data
declared
return statement
5. Boolean type conversions are ___________
prefix form
not possible
parentheses
class
6. 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
conditional statement
String nextLine( )
7. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
String replace (char oldChar - char newChar)
self-governing
string literal
instance data
8. Methods in the Math class are ______
static
Random class
inheritance
aliases
9. Four integer data types: byte - short - int - _____
accessor method
String findInLine (String pattern)
long
variable declaration
10. 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
arithmetic
aliases
character literal
encapsulation
11. Declared in a class but not inside any particular method
instance data
return statement
boolean nextBoolean( )
class level
12. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
String substring (int offset - int endIndex)
java.lang package
parameter
String format (double number)
13. The one that is invoked
flow of control
class
int compareTo (String str)
called method
14. The Scanner class is part of ___________________
pointer
the "import" declaration
String next( )
java.util class libary
15. The names of the parameters in the header of the method declaration
byte to short
method invocation
Scanner useDelimiter(String pattern)
formal parameters
16. Expressed in a Java program with single quotes
delimiters
double
character literal
variable name
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.
assignment conversion
a constructor
autoboxing
byte nextByte( )
18. Returns the next input token as the indicated type.
boolean nextBoolean( )
null
parameter
character string
19. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
state of an object
java.util class libary
wrapper class
promotion
20. The act of creating an object using the "new" operator
constants
instantiation
int compareTo (String str)
parameter list
21. Returns a new string consisting of this string concatenated with str.
String concat (String str)
instance variable
return statement
encapsulation
22. 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
wrapper class
boolean nextBoolean( )
boolean equalsIgnoreCase (String str)
parentheses
23. 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
RH
escape sequences
variable declaration
local data
24. Each piece of data that we send to a method
RH
char charAt (int index)
parameter
assignment
25. The classes of the Java standard class library are grouped into __________.
inheritance
packages
polymorphism
num=Integer.parseInt(str);
26. Constructor: creates a new pseudorandom number generator.
Random ( )
tokens
accessor method
literal
27. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
class level
RH
parentheses
boolean equals (String str)
28. 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.
expression
parentheses
enumerated type
int length( )
29. Constructor: creates a new string object with the same characters as str.
floating point numbers
String (String str)
initialize
arithmetic
30. All wrapper classes are defined in ___________
inheritance
visibility modifiers
java.lang package
String concat (String str)
31. ++count; -- count
data values
enumerated type
prefix form
mutator method
32. Variables and constants can be referenced in any method of the class by declaring at the _________
initialize
instance variable
class level
Understanding
33. 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.
encapsulation
reference
method invocation
String findInLine (String pattern)
34. This declaration creates a Scanner object that reads input from the keyboard
not possible
Random ( )
assignment
Scanner scan=new Scanner (System.in);
35. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
arithmetic
behaviors of an object
char charAt (int index)
parameter
36. Sets the scanner's delimiting pattern.
signed
delimiters
num=Integer.parseInt(str);
Scanner useDelimiter(String pattern)
37. An explicit data value used in a program
return statement
private
literal
boolean nextBoolean( )
38. 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
import java.util*
method invocation
return statement
behaviors of an object
39. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
String substring (int offset - int endIndex)
arithmetic
local data
40. Modifier>type/void>identifier>parameters>method body
uninitialized variables
method declaration
method
header of a method
41. A variable that refers to an object must be __________
variable
a constructor
declared
tokens
42. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
boolean equalsIgnoreCase (String str)
import java.util*
int compareTo (String str)
boolean equals (String str)
43. format for constants: all upper-case; separated by ________
underscores
floating point numbers
character literal
local data
44. The order in which statements are executed in a running program
conditionals
uninitialized variables
flow of control
boolean equals (String str)
45. 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
class
a constructor
System.out.println
encapsulation of an object
46. After an object has been instantiated - we set the _________ to access its methods
long
dot operator
wrapper class
declared
47. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
prefix form
tokens
accessor method
constants
48. A set of classes that supports the development of programs
class library
assignment statement
String findInLine (String pattern)
class level
49. Constructors do not even _______; therefore they cannot return a value.
have void
wrapper class
delimiters
Scanner class
50. Changes a particular value - e.g.setX - where X is the value they are setting.
mutator method
instance variable
wrapper class
service methods