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 that is a subset of this string starting at index offset and extending through endIndx-1;
String substring (int offset - int endIndex)
mutator method
a constructor
enumerated type
2. Returns a string containing the specified number formatted according to this object's pattern.
encapsulation of an object
boolean nextBoolean( )
set
String format (double number)
3. Also called a selection statement b/c it allows us to choose which statement will be executed next.
constructors
encapsulation of an object
inheritance
conditional statement
4. 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
int length( )
NumberFormat class
String next( )
variable declaration
5. 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.
parameter list
support methods
method invocation
Scanner scan=new Scanner (System.in);
6. Every object has two things: a state and a _____ of behaviors
set
parameter list
operations
tokens
7. A ________________ is immutable.
long
pointer
String object
character string
8. 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
not possible
String object
boolean hasNext( )
9. Instance data should be defined with what________ visibility
private
Scanner class
null
String toLowerCase ( )
10. 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:
dot operator
string name;
num=Integer.parseInt(str);
postfix form
11. 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
character literal
expression
tokens
Scanner class
12. Constructor: creates a new string object with the same characters as str.
character literal
String (String str)
pointer
null
13. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
not possible
self-governing
service methods
public
14. A method that returns a value must have a _________
instance variable
System.out.println
return statement
constants
15. Constructor: creates a new pseudorandom number generator.
a constructor
Scanner scan=new Scanner (System.in);
polymorphism
Random ( )
16. Declared in a class but not inside any particular method
Understanding
instance data
higher
String toLowerCase ( )
17. 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
int compareTo (String str)
method declaration
encapsulation
Scanner class
18. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
state of an object
behaviors of an object
num=Integer.parseInt(str);
the DecimalFormat class
19. An object in Java - defined by the class String
character string
String toUpperCase ( )
dot operator
String toLowerCase ( )
20. The names of the parameters in the header of the method declaration
Scanner useDelimiter(String pattern)
String toUpperCase ( )
formal parameters
instance variable
21. Returns the next input token as a character string.
uninitialized variables
method declaration
String next( )
boolean equals (String str)
22. A variable that refers to an object must be __________
String object
assignment statement
declared
the "import" declaration
23. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
instance variable
boolean nextBoolean( )
assignment
accessor method
24. 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
string literal
aliases
support methods
primitive variables
25. Part of the java.util class; picks a number at random out of a range of values.
long
autoboxing
Random class
String nextLine( )
26. Five steps of problem-solving: ____________ the problem - Designing a solution - Considering alternatives to the solution and refining the solution - Implementing the solution - Testing the solution and fixing any problems that exist
boolean equals (String str)
Understanding
method
boolean hasNext( )
27. Constants are ______ because the can't be changed once you use the final modifier
public
boolean hasNext( )
formal parameters
a constructor
28. Returns the number of characters in this stirng.
variable name
method invocation
support methods
int length( )
29. 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
set
string name;
long
packages
30. Returns the character at the specified index.
char charAt (int index)
called method
delimiters
have void
31. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
self-governing
static int parseInt (String str)
boolean equals (String str)
header of a method
32. Two categories of statements that control the flow of executing through a method: __________ and loops
System.out.println
method invocation
conditionals
called method
33. When a variable is declared inside a method
class
boolean hasNext( )
local data
underscores
34. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
int compareTo (String str)
Random ( )
promotion
tokens
35. Variables that don't contain any data
long
parameter list
parameter
uninitialized variables
36. Variables and constants can be referenced in any method of the class by declaring at the _________
class level
String nextLine( )
floating point numbers
variable
37. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
import java.util*
String findInLine (String pattern)
boolean value
primitive variables
38. Methods in the Math class are ______
dot operator
RH
signed
static
39. 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
conditionals
string literal
scope
method
40. Cast operator has _________ precedence to division
static int parseInt (String str)
higher
boolean nextBoolean( )
casting
41. Returns a new string consisting of this string concatenated with str.
have void
encapsulation of an object
the DecimalFormat class
boolean equals (String str)
42. Widening byte: _________ - to int - to long - to float - to double
service methods
aliases
parameter
byte to short
43. White space characters such as space characters - tabs - and new lines that separate the elements of input
num=Integer.parseInt(str);
String next( )
escape sequences
delimiters
44. Boolean type conversions are ___________
mutator method
Understanding
not possible
assignment conversion
45. Returns all input remaining on the current line as a character string.
pointer
character string
String nextLine( )
set
46. Returns the next input token as the indicated type.
boolean nextBoolean( )
conditionals
scope
have void
47. A value that is passed into a method when it is invoked
parameter
support methods
String nextLine( )
String toUpperCase ( )
48. The one that is invoked
called method
pointer
not possible
String toUpperCase ( )
49. A null reference indicates that a variable does not refer to an object
null
Random ( )
int compareTo (String str)
String format (double number)
50. 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
encapsulation of an object
conditionals
visibility modifiers