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. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
accessor method
Scanner useDelimiter(String pattern)
parameter
2. An object in Java - defined by the class String
character string
enumerated type
encapsulation
method
3. A method that returns a value must have a _________
String next( )
packages
return statement
method
4. Constants are ______ because the can't be changed once you use the final modifier
variable declaration
public
set
underscores
5. Returns the character at the specified index.
formal parameters
actual parameters
char charAt (int index)
Random ( )
6. Instance data should be defined with what________ visibility
state of an object
private
string name;
int length( )
7. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
casting
method invocation
support methods
8. After an object has been instantiated - we set the _________ to access its methods
Scanner class
dot operator
import java.util*
class
9. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
Scanner class
parameter
variable name
10. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
data values
static
enumerated type
accessor method
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
inheritance
formal parameters
string literal
boolean equalsIgnoreCase (String str)
12. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
byte nextByte( )
java.lang package
boolean hasNext( )
13. 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
attributes of an object
behaviors of an object
casting
14. _____ expression evaluated first
polymorphism
static
RH
uninitialized variables
15. Widening byte: _________ - to int - to long - to float - to double
flow of control
String (String str)
byte to short
parentheses
16. We use an object when we have a _________ to it
String findInLine (String pattern)
polymorphism
java.lang package
reference
17. All wrapper classes are defined in ___________
parentheses
java.lang package
string name;
null
18. A variable that refers to an object must be __________
RH
int compareTo (String str)
state of an object
declared
19. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
expression
pointer
java.lang package
String substring (int offset - int endIndex)
20. 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.
NumberFormat class
null
enumerated type
String object
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
aliases
attributes of an object
String concat (String str)
not possible
22. ______________ operators have higher precedence
escape sequences
arithmetic
conditionals
local data
23. This declaration creates a Scanner object that reads input from the keyboard
parameter
Scanner scan=new Scanner (System.in);
null
conditional statement
24. Expressed in a Java program with single quotes
Random ( )
character literal
constants
java.lang package
25. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
operations
pointer
behaviors of an object
boolean value
26. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
literal
assignment
accessor method
27. Part of the standard Java class library - provides convenient methods for reading input values of various types. the input can come from various sources - including data typed interactively by the user or data stored in a file; the Scanner class can
delimiters
constants
primitive variables
Scanner class
28. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
autoboxing
reserved word void
method invocation
promotion
29. The declarations of object variables have a similar structure to the declaration of _______________
String concat (String str)
autoboxing
method invocation
primitive variables
30. Constructor: creates a new pseudorandom number generator.
Random ( )
boolean equals (String str)
assignment
String (String str)
31. A ________________ is immutable.
static int parseInt (String str)
signed
variable declaration
String object
32. Elements of input
java.lang package
called method
wrapper class
tokens
33. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
boolean equalsIgnoreCase (String str)
prefix form
NumberFormat class
boolean hasNext( )
34. All numeric types are _______ - meaning both positive and negative values can be stored in them
signed
constants
aliases
called method
35. Methods in the Math class are ______
service methods
static
have void
constants
36. 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.
pointer
class
Random class
scope
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
instance data
autoboxing
class level
method
38. Every object has two things: a state and a _____ of behaviors
boolean value
Random class
set
method declaration
39. 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
aliases
promotion
expression
String (String str)
40. Boolean type conversions are ___________
character string
null
actual parameters
not possible
41. Protection and management of an object's info. this implies that the object should be self-governing. the only changes made to the state of the object should be accomplished by that object's methods. other objects should not be able to "reach in" to
method declaration
String concat (String str)
scope
encapsulation of an object
42. The one that is invoked
return statement
reserved word void
called method
set
43. The classes of the Java standard class library are grouped into __________.
String next( )
packages
set
static
44. Returns the int corresponding to the value stored in the specified string
delimiters
expression
static int parseInt (String str)
num=Integer.parseInt(str);
45. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
aliases
method declaration
set
boolean equalsIgnoreCase (String str)
46. They clarify the role a certain number has in the program.
String format (double number)
constants
the "import" declaration
aliases
47. 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.
private
Random ( )
state of an object
reserved word void
48. When a variable is declared inside a method
local data
encapsulation of an object
constants
mutator method
49. An explicit data value used in a program
int length( )
data values
literal
class level
50. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
public
int length( )
support methods
long