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. Constants are ______ because the can't be changed once you use the final modifier
instance data
static int parseInt (String str)
data values
public
2. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
accessor method
static
class
reference
3. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
local data
boolean equalsIgnoreCase (String str)
support methods
double
4. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
behaviors of an object
boolean equals (String str)
arithmetic
string literal
5. Represents either a primitive value or an object
flow of control
java.lang package
primitive variables
variable name
6. 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
pointer
boolean value
encapsulation of an object
conditionals
7. Sets the scanner's delimiting pattern.
double
arithmetic
Scanner useDelimiter(String pattern)
method invocation
8. Elements of input
tokens
variable declaration
byte to short
escape sequences
9. 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
static int parseInt (String str)
method
int compareTo (String str)
self-governing
10. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance data
String replace (char oldChar - char newChar)
instance variable
String format (double number)
11. 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
num=Integer.parseInt(str);
static int parseInt (String str)
inheritance
method declaration
12. ______________ operators have higher precedence
string name;
arithmetic
java.lang package
behaviors of an object
13. 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.
higher
primitive variables
class
polymorphism
14. Returns the int corresponding to the value stored in the specified string
static int parseInt (String str)
public
wrapper class
packages
15. Modifier>type/void>identifier>parameters>method body
method declaration
inheritance
attributes of an object
formal parameters
16. New memory space is reserved for that variable every time an instance of the class that is created.
instance data
service methods
header of a method
method declaration
17. Constructor: creates a new string object with the same characters as str.
floating point numbers
method declaration
parameter
String (String str)
18. Two floating data types: float - _______
uninitialized variables
Scanner class
double
header of a method
19. Returns all input remaining on the current line as a character string.
String nextLine( )
class library
Scanner class
instance data
20. Constructor: creates a new pseudorandom number generator.
initialize
operations
postfix form
Random ( )
21. A variable that refers to an object must be __________
declared
int length( )
public
literal
22. Delimited by double quotation characters
higher
operations
autoboxing
string literal
23. Variables that don't contain any data
String replace (char oldChar - char newChar)
expression
uninitialized variables
parameter
24. All numeric types are _______ - meaning both positive and negative values can be stored in them
instance data
character string
signed
primitive variables
25. Four integer data types: byte - short - int - _____
casting
long
underscores
boolean equalsIgnoreCase (String str)
26. sides=10;
wrapper class
formal parameters
assignment statement
flow of control
27. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
NumberFormat class
aliases
set
null
28. 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
byte nextByte( )
attributes of an object
instance data
actual parameters
29. Returns a new string consisting of this string concatenated with str.
underscores
parentheses
boolean equals (String str)
String replace (char oldChar - char newChar)
30. 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
accessor method
initialize
pointer
java.lang package
31. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
java.lang package
called method
String replace (char oldChar - char newChar)
boolean equalsIgnoreCase (String str)
32. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
higher
return statement
encapsulation of an object
state of an object
33. Each piece of data that we send to a method
assignment conversion
String findInLine (String pattern)
parameter
literal
34. An object in Java - defined by the class String
character string
static int parseInt (String str)
private
uninitialized variables
35. 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)
the DecimalFormat class
accessor method
boolean hasNext( )
36. The values passed into a method in an invocation; these are called the arguments to the method
tokens
expression
actual parameters
java.lang package
37. 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
Understanding
Random class
accessor method
38. 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.
aliases
instance variable
variable declaration
enumerated type
39. Widening byte: _________ - to int - to long - to float - to double
underscores
instance data
instance variable
byte to short
40. An object has behaviors - which are defined by the ________ associated with that object.
visibility modifiers
parameter list
operations
pointer
41. The automatic conversion between a primitive value and a corresponding wrapper object.
instantiation
autoboxing
uninitialized variables
static int parseInt (String str)
42. The classes of the Java standard class library are grouped into __________.
packages
static int parseInt (String str)
method declaration
string literal
43. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
self-governing
java.lang package
parameter
public
44. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
parentheses
called method
byte to short
behaviors of an object
45. 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 toUpperCase ( )
encapsulation
boolean equals (String str)
import java.util*
46. A null reference indicates that a variable does not refer to an object
null
packages
static int parseInt (String str)
the "import" declaration
47. Before you use a variable __________it
initialize
encapsulation
int compareTo (String str)
variable name
48. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
service methods
prefix form
NumberFormat class
higher
49. 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.
character literal
parameter
assignment conversion
arithmetic
50. 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
assignment
expression
string literal
actual parameters