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. 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.
variable declaration
System.out.println
enumerated type
signed
2. Before you use a variable __________it
initialize
assignment conversion
the DecimalFormat class
dot operator
3. 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
public
underscores
pointer
variable declaration
4. Returns the next input token as the indicated type.
String findInLine (String pattern)
enumerated type
byte nextByte( )
called method
5. Returns the number of characters in this stirng.
the "import" declaration
conditionals
autoboxing
int length( )
6. 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
return statement
self-governing
method
string literal
7. Represents either a primitive value or an object
variable name
method
formal parameters
import java.util*
8. We use an object when we have a _________ to it
higher
character string
reference
Scanner scan=new Scanner (System.in);
9. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
actual parameters
NumberFormat class
String toUpperCase ( )
String toLowerCase ( )
10. Cast operator has _________ precedence to division
higher
self-governing
conditional statement
static
11. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
String (String str)
support methods
private
String nextLine( )
12. Constructor: creates a new pseudorandom number generator.
visibility modifiers
Random ( )
expression
null
13. An object has behaviors - which are defined by the ________ associated with that object.
state of an object
data values
class
operations
14. Attempts to find the next occurence of the specified pattern - ignoring delimiters
String toUpperCase ( )
primitive variables
dot operator
String findInLine (String pattern)
15. Delimited by double quotation characters
string literal
method invocation
constants
static int parseInt (String str)
16. A name for a location in memory used to hold a data value.
assignment
character string
variable
class
17. New memory space is reserved for that variable every time an instance of the class that is created.
String object
instance data
public
accessor method
18. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
constructors
arithmetic
not possible
String (String str)
19. 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
postfix form
method invocation
Random class
primitive variables
20. sides=10;
assignment statement
floating point numbers
variable
System.out.println
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
reference
accessor method
attributes of an object
instance data
22. A null reference indicates that a variable does not refer to an object
null
byte nextByte( )
expression
char charAt (int index)
23. A class usually provides services to access and modify __________
autoboxing
instance data
escape sequences
data values
24. Constants are ______ because the can't be changed once you use the final modifier
boolean nextBoolean( )
formal parameters
public
boolean value
25. 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.
String toUpperCase ( )
private
parameter list
method invocation
26. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
String nextLine( )
instance variable
String substring (int offset - int endIndex)
local data
27. The order in which statements are executed in a running program
data values
int length( )
initialize
flow of control
28. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
RH
expression
class
29. ______________ operators have higher precedence
java.lang package
byte to short
arithmetic
Scanner useDelimiter(String pattern)
30. Four integer data types: byte - short - int - _____
java.util class libary
long
wrapper class
floating point numbers
31. When a variable is declared inside a method
instance data
packages
local data
promotion
32. Return type specified in the method header can be a primitive type - class name or the ________; when a method does not return any value - void is used as the return type - as is always done with the main method.
RH
reserved word void
String findInLine (String pattern)
string name;
33. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
support methods
tokens
byte nextByte( )
instance variable
34. An object in Java - defined by the class String
character string
floating point numbers
declared
public
35. A variable that refers to an object must be __________
variable
java.lang package
declared
set
36. 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
the DecimalFormat class
expression
Understanding
casting
37. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
literal
higher
instance data
behaviors of an object
38. Two floating data types: float - _______
double
autoboxing
boolean hasNext( )
reference
39. 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
String object
num=Integer.parseInt(str);
inheritance
promotion
40. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
underscores
accessor method
packages
String concat (String str)
41. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
null
self-governing
String replace (char oldChar - char newChar)
delimiters
42. Returns a new string consisting of this string concatenated with str.
behaviors of an object
String substring (int offset - int endIndex)
String format (double number)
boolean equals (String str)
43. 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
java.lang package
import java.util*
class level
44. A ________________ is immutable.
variable declaration
String object
double
variable
45. 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
import java.util*
class
formal parameters
46. Also called a selection statement b/c it allows us to choose which statement will be executed next.
String toLowerCase ( )
boolean equalsIgnoreCase (String str)
encapsulation of an object
conditional statement
47. 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
the DecimalFormat class
prefix form
long
48. A value that is passed into a method when it is invoked
escape sequences
parameter
packages
prefix form
49. Constructor: creates a new string object with the same characters as str.
static
conditionals
String (String str)
set
50. Returns the next input token as the indicated type.
String object
scope
boolean nextBoolean( )
static