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. Constructor: creates a new pseudorandom number generator.
parameter
dot operator
reference
Random ( )
2. 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
class
String findInLine (String pattern)
method invocation
String object
3. After an object has been instantiated - we set the _________ to access its methods
have void
dot operator
long
static
4. A set of classes that supports the development of programs
Scanner class
String findInLine (String pattern)
class library
data values
5. The classes of the Java standard class library are grouped into __________.
packages
wrapper class
higher
String nextLine( )
6. This declaration creates a Scanner object that reads input from the keyboard
escape sequences
conditional statement
Scanner scan=new Scanner (System.in);
String format (double number)
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
String concat (String str)
attributes of an object
parameter
aliases
8. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
set
not possible
static
accessor method
9. Also called a selection statement b/c it allows us to choose which statement will be executed next.
tokens
String replace (char oldChar - char newChar)
reserved word void
conditional statement
10. 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
String toUpperCase ( )
a constructor
accessor method
class library
11. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
not possible
string name;
casting
constructors
12. A value that is passed into a method when it is invoked
System.out.println
parameter
aliases
have void
13. Specifies the packages and classes that will be used in a program so that the fully qualified name is not necessary with each reference.
the "import" declaration
long
self-governing
arithmetic
14. Delimited by double quotation characters
arithmetic
method declaration
aliases
string literal
15. Each piece of data that we send to a method
constructors
String nextLine( )
parameter
String next( )
16. Changes a particular value - e.g.setX - where X is the value they are setting.
mutator method
higher
uninitialized variables
instance data
17. The one that is invoked
Random ( )
support methods
called method
floating point numbers
18. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
attributes of an object
header of a method
method declaration
operations
19. Methods in the Math class are ______
static
expression
enumerated type
class
20. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
behaviors of an object
int compareTo (String str)
arithmetic
polymorphism
21. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
assignment
num=Integer.parseInt(str);
String substring (int offset - int endIndex)
method
22. 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
casting
primitive variables
double
byte nextByte( )
23. When a variable is declared inside a method
header of a method
enumerated type
local data
String object
24. 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.
underscores
formal parameters
initialize
scope
25. Two floating data types: float - _______
scope
String toUpperCase ( )
java.util class libary
double
26. Part of the java.util class; picks a number at random out of a range of values.
character string
Random class
num=Integer.parseInt(str);
boolean nextBoolean( )
27. _____ expression evaluated first
string name;
parameter
RH
String concat (String str)
28. Returns the int corresponding to the value stored in the specified string
num=Integer.parseInt(str);
packages
boolean value
static int parseInt (String str)
29. 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
pointer
the DecimalFormat class
behaviors of an object
character string
30. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
Random ( )
a constructor
NumberFormat class
service methods
31. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
flow of control
import java.util*
parentheses
byte to short
32. 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
initialize
return statement
constants
33. Expressed in a Java program with single quotes
character literal
higher
packages
tokens
34. Widening byte: _________ - to int - to long - to float - to double
conditional statement
method declaration
a constructor
byte to short
35. 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
NumberFormat class
variable declaration
called method
method invocation
36. Returns the next input token as the indicated type.
byte nextByte( )
Scanner useDelimiter(String pattern)
called method
Random ( )
37. 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
constants
method
primitive variables
uninitialized variables
38. The declarations of object variables have a similar structure to the declaration of _______________
primitive variables
String replace (char oldChar - char newChar)
Understanding
encapsulation
39. A name for a location in memory used to hold a data value.
flow of control
variable
assignment conversion
not possible
40. System.out object represents an output device or file; we send the println message to the System.out object to request that some text be printed
dot operator
encapsulation
System.out.println
postfix form
41. 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.
method
java.lang package
behaviors of an object
reserved word void
42. A variable that refers to an object must be __________
declared
service methods
int length( )
method
43. 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 -
variable
class
self-governing
data values
44. Modifier>type/void>identifier>parameters>method body
method declaration
public
conditionals
java.lang package
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
instance data
the DecimalFormat class
Scanner class
46. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
String concat (String str)
instance data
NumberFormat class
assignment statement
47. New memory space is reserved for that variable every time an instance of the class that is created.
wrapper class
constructors
instance data
reference
48. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
polymorphism
static int parseInt (String str)
not possible
import java.util*
49. Four integer data types: byte - short - int - _____
signed
int compareTo (String str)
instance variable
long
50. Returns a new string consisting of this string concatenated with str.
autoboxing
String concat (String str)
instantiation
boolean equalsIgnoreCase (String str)