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. 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.
string literal
static int parseInt (String str)
encapsulation
String concat (String str)
2. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
have void
string name;
boolean equalsIgnoreCase (String str)
java.lang package
3. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
expression
behaviors of an object
String toUpperCase ( )
private
4. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
reference
self-governing
Understanding
header of a method
5. 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.
string literal
Understanding
parameter
polymorphism
6. 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
boolean equals (String str)
expression
string name;
declared
7. 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
assignment conversion
state of an object
attributes of an object
num=Integer.parseInt(str);
8. Returns the number of characters in this stirng.
int length( )
formal parameters
String substring (int offset - int endIndex)
dot operator
9. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
boolean equalsIgnoreCase (String str)
data values
string literal
String substring (int offset - int endIndex)
10. Before you use a variable __________it
initialize
variable name
not possible
operations
11. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
Scanner scan=new Scanner (System.in);
flow of control
import java.util*
12. Widening byte: _________ - to int - to long - to float - to double
behaviors of an object
service methods
byte to short
variable declaration
13. A group of programming statements that is given a name. when a method is invoked - its statements are executed. a set of methods is associated with an object and defines its potential behaviors. to define the ability to make a deposit into a bank acc
attributes of an object
header of a method
actual parameters
method
14. The one that is invoked
reference
the "import" declaration
Understanding
called method
15. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
import java.util*
tokens
class level
encapsulation of an object
16. 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.
boolean hasNext( )
character string
parameter list
dot operator
17. ++count; -- count
prefix form
private
method invocation
state of an object
18. The act of creating an object using the "new" operator
uninitialized variables
boolean value
instantiation
class library
19. When a variable is declared inside a method
class
local data
polymorphism
arithmetic
20. 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
return statement
string name;
Scanner scan=new Scanner (System.in);
inheritance
21. Constructor: creates a new pseudorandom number generator.
Understanding
delimiters
self-governing
Random ( )
22. Constructor: creates a new string object with the same characters as str.
literal
service methods
String (String str)
scope
23. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
packages
character string
accessor method
tokens
24. Count++; count--
string literal
wrapper class
flow of control
postfix form
25. Boolean type conversions are ___________
local data
behaviors of an object
not possible
postfix form
26. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
self-governing
long
class level
String replace (char oldChar - char newChar)
27. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
String next( )
instance variable
String replace (char oldChar - char newChar)
self-governing
28. 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.
String (String str)
scope
boolean nextBoolean( )
initialize
29. Returns the next input token as the indicated type.
String next( )
promotion
parameter
byte nextByte( )
30. A special method that has the same name as the class. After the "new" operator creates the object it is invoked to help set it up initially
delimiters
java.lang package
byte nextByte( )
a constructor
31. 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
initialize
dot operator
pointer
32. 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
java.lang package
self-governing
postfix form
expression
33. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
literal
byte nextByte( )
String replace (char oldChar - char newChar)
Random ( )
34. Two floating data types: float - _______
attributes of an object
double
Scanner scan=new Scanner (System.in);
method invocation
35. 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.
enumerated type
encapsulation of an object
NumberFormat class
long
36. 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:
double
num=Integer.parseInt(str);
reference
not possible
37. We use an object when we have a _________ to it
method
visibility modifiers
import java.util*
reference
38. Each piece of data that we send to a method
the "import" declaration
primitive variables
Scanner scan=new Scanner (System.in);
parameter
39. ____________ is instantiated in the traditional way using the new operator.
String format (double number)
the DecimalFormat class
initialize
promotion
40. Returns true if the scanner has anotehr token in its input.
called method
tokens
int compareTo (String str)
boolean hasNext( )
41. New memory space is reserved for that variable every time an instance of the class that is created.
java.lang package
mutator method
instance data
String findInLine (String pattern)
42. Returns a new string consisting of this string concatenated with str.
reference
char charAt (int index)
static int parseInt (String str)
boolean equals (String str)
43. An explicit data value used in a program
literal
null
called method
wrapper class
44. Constants are ______ because the can't be changed once you use the final modifier
casting
set
public
actual parameters
45. The Scanner class is part of ___________________
java.util class libary
local data
constructors
signed
46. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
inheritance
Random class
support methods
class library
47. Instance data should be defined with what________ visibility
arithmetic
assignment
String toLowerCase ( )
private
48. A method that returns a value must have a _________
string literal
String replace (char oldChar - char newChar)
casting
return statement
49. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
java.lang package
prefix form
Random ( )
character literal
50. Expressed in a Java program with single quotes
constructors
static int parseInt (String str)
character literal
private