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. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
header of a method
promotion
byte to short
variable name
2. format for constants: all upper-case; separated by ________
byte nextByte( )
flow of control
null
underscores
3. All wrapper classes are defined in ___________
java.lang package
delimiters
escape sequences
string literal
4. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
encapsulation
instance data
int compareTo (String str)
arithmetic
5. The act of creating an object using the "new" operator
parentheses
visibility modifiers
instantiation
Random class
6. 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)
tokens
uninitialized variables
header of a method
7. An object has behaviors - which are defined by the ________ associated with that object.
String findInLine (String pattern)
operations
java.lang package
tokens
8. The blueprint of an object. establishes the kind of data an object of that type will hold and defines the methods that represent the behavior of such objects. however - a class contains no space to store data. each object has space for its own data -
flow of control
class
static int parseInt (String str)
a constructor
9. 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
operations
parameter
String findInLine (String pattern)
10. Returns the next input token as the indicated type.
byte nextByte( )
parentheses
constructors
reference
11. Sets the scanner's delimiting pattern.
variable declaration
a constructor
postfix form
Scanner useDelimiter(String pattern)
12. sides=10;
character string
assignment statement
Scanner scan=new Scanner (System.in);
assignment conversion
13. Variables that don't contain any data
uninitialized variables
data values
actual parameters
the "import" declaration
14. Methods in the Math class are ______
static
private
String findInLine (String pattern)
assignment statement
15. Constructors do not even _______; therefore they cannot return a value.
int compareTo (String str)
import java.util*
have void
service methods
16. Modifier>type/void>identifier>parameters>method body
Understanding
character literal
long
method declaration
17. Every object has two things: a state and a _____ of behaviors
postfix form
underscores
set
variable
18. 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
parameter
data values
encapsulation of an object
arithmetic
19. Returns the next input token as the indicated type.
parameter
boolean nextBoolean( )
private
String format (double number)
20. ____________ is instantiated in the traditional way using the new operator.
boolean value
Random class
String substring (int offset - int endIndex)
the DecimalFormat class
21. The values it stores internally - which may be represented as primitive data or as other objects. for example - a bank account object can store a floating point number (a primitive value) that represents the balance of the account. it can also contai
String concat (String str)
set
assignment conversion
attributes of an object
22. 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
String format (double number)
null
variable declaration
variable name
23. 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
static
scope
public
24. We use an object when we have a _________ to it
local data
conditional statement
String concat (String str)
reference
25. Returns the int corresponding to the value stored in the specified string
state of an object
String findInLine (String pattern)
packages
static int parseInt (String str)
26. Boolean type conversions are ___________
int compareTo (String str)
return statement
not possible
character string
27. A ________________ is immutable.
int length( )
String toUpperCase ( )
variable declaration
String object
28. 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);
int length( )
instance variable
support methods
29. Three ways in which Java conversions occur: _________ conversion - promotion - casting
escape sequences
double
assignment
num=Integer.parseInt(str);
30. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
service methods
String toUpperCase ( )
method
Understanding
31. The classes of the Java standard class library are grouped into __________.
byte nextByte( )
char charAt (int index)
dot operator
packages
32. 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.
parameter list
encapsulation
assignment
System.out.println
33. 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
prefix form
expression
assignment
instance variable
34. Widening byte: _________ - to int - to long - to float - to double
parameter
byte to short
int length( )
private
35. The names of the parameters in the header of the method declaration
java.util class libary
boolean value
reserved word void
formal parameters
36. An object in Java - defined by the class String
character string
operations
private
assignment conversion
37. The automatic conversion between a primitive value and a corresponding wrapper object.
reserved word void
autoboxing
class library
assignment conversion
38. 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;
assignment
the "import" declaration
actual parameters
39. 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
String format (double number)
autoboxing
attributes of an object
casting
40. Returns the character at the specified index.
assignment
actual parameters
byte nextByte( )
char charAt (int index)
41. The values passed into a method in an invocation; these are called the arguments to the method
String substring (int offset - int endIndex)
data values
actual parameters
String toLowerCase ( )
42. 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)
tokens
class library
not possible
43. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
the DecimalFormat class
String findInLine (String pattern)
support methods
String (String str)
44. Also called a selection statement b/c it allows us to choose which statement will be executed next.
boolean equalsIgnoreCase (String str)
reference
Scanner scan=new Scanner (System.in);
conditional statement
45. After an object has been instantiated - we set the _________ to access its methods
accessor method
String next( )
dot operator
instance data
46. Before you use a variable __________it
parentheses
NumberFormat class
boolean value
initialize
47. Expressed in a Java program with single quotes
primitive variables
higher
character literal
the DecimalFormat class
48. ++count; -- count
parameter list
null
prefix form
byte nextByte( )
49. A variable that refers to an object must be __________
called method
primitive variables
declared
assignment
50. Four integer data types: byte - short - int - _____
java.util class libary
long
reference
return statement