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. The one that is invoked
called method
Scanner class
class
enumerated type
2. An object has behaviors - which are defined by the ________ associated with that object.
String (String str)
string literal
operations
instance data
3. When a variable is declared inside a method
local data
public
constructors
long
4. Returns a new string consisting of this string concatenated with str.
String concat (String str)
Scanner scan=new Scanner (System.in);
java.lang package
actual parameters
5. 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 -
underscores
long
String toUpperCase ( )
class
6. A method that returns a value must have a _________
private
String toLowerCase ( )
return statement
import java.util*
7. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
support methods
boolean hasNext( )
wrapper class
service methods
8. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
boolean nextBoolean( )
instance variable
state of an object
the DecimalFormat class
9. 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
java.util class libary
assignment statement
pointer
10. Begins with a backslash character ""
escape sequences
string name;
the DecimalFormat class
set
11. An object in Java - defined by the class String
the "import" declaration
long
character string
Random class
12. Changes a particular value - e.g.setX - where X is the value they are setting.
class
Scanner scan=new Scanner (System.in);
mutator method
reserved word void
13. Variables and constants can be referenced in any method of the class by declaring at the _________
class level
flow of control
RH
a constructor
14. 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
parameter
expression
instance data
15. A class usually provides services to access and modify __________
data values
arithmetic
polymorphism
Scanner class
16. A variable that refers to an object must be __________
declared
Scanner scan=new Scanner (System.in);
int compareTo (String str)
header of a method
17. Returns the next input token as the indicated type.
boolean nextBoolean( )
visibility modifiers
dot operator
called method
18. Declared in a class but not inside any particular method
byte to short
instance data
pointer
Understanding
19. Returns the number of characters in this stirng.
int length( )
byte to short
instance data
variable name
20. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
casting
visibility modifiers
constructors
accessor method
21. After an object has been instantiated - we set the _________ to access its methods
static
variable name
java.lang package
dot operator
22. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
String findInLine (String pattern)
class library
promotion
operations
23. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
assignment conversion
boolean hasNext( )
parentheses
scope
24. This declaration creates a Scanner object that reads input from the keyboard
String toUpperCase ( )
Scanner scan=new Scanner (System.in);
the "import" declaration
String concat (String str)
25. Sets the scanner's delimiting pattern.
parameter
accessor method
Scanner useDelimiter(String pattern)
wrapper class
26. Only two valid values: true and false; can indicate whether a particular condition is true - but can also be used to represent any situation that has two states - such as a light bulb being on or off
scope
boolean value
prefix form
support methods
27. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
signed
service methods
static
28. The declarations of object variables have a similar structure to the declaration of _______________
primitive variables
the DecimalFormat class
dot operator
reserved word void
29. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
char charAt (int index)
instance data
byte to short
NumberFormat class
30. A null reference indicates that a variable does not refer to an object
not possible
class library
null
static int parseInt (String str)
31. 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.
declared
character literal
set
scope
32. Returns the next input token as a character string.
return statement
String next( )
String format (double number)
string literal
33. The idea that we can refer to multiple types of related objects over time in consistent ways. it gives us the ability to design powerful and elegant solutions to problems that deal with multiple objects.
constants
num=Integer.parseInt(str);
polymorphism
boolean equalsIgnoreCase (String str)
34. sides=10;
method declaration
data values
assignment statement
behaviors of an object
35. 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:
higher
num=Integer.parseInt(str);
String toUpperCase ( )
delimiters
36. 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
variable declaration
reference
import java.util*
wrapper class
37. Modifier>type/void>identifier>parameters>method body
java.lang package
method declaration
encapsulation
dot operator
38. The act of creating an object using the "new" operator
string literal
behaviors of an object
private
instantiation
39. 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.
String object
behaviors of an object
delimiters
enumerated type
40. The automatic conversion between a primitive value and a corresponding wrapper object.
a constructor
autoboxing
Scanner class
uninitialized variables
41. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
class level
constructors
mutator method
42. The Scanner class is part of ___________________
have void
NumberFormat class
instance data
java.util class libary
43. We use an object when we have a _________ to it
reference
arithmetic
parameter
attributes of an object
44. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
Scanner useDelimiter(String pattern)
character string
String toLowerCase ( )
operations
45. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
uninitialized variables
support methods
String toUpperCase ( )
operations
46. 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
aliases
parameter
inheritance
state of an object
47. Constants are ______ because the can't be changed once you use the final modifier
public
behaviors of an object
class
string literal
48. Returns the next input token as the indicated type.
tokens
byte nextByte( )
constructors
delimiters
49. The names of the parameters in the header of the method declaration
variable
formal parameters
inheritance
Random class
50. Widening byte: _________ - to int - to long - to float - to double
static
import java.util*
byte to short
underscores