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. 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
parameter list
encapsulation
method
scope
2. A method that returns a value must have a _________
character string
instance variable
String next( )
return statement
3. Declared in a class but not inside any particular method
static
not possible
instance data
declared
4. Constructor: creates a new string object with the same characters as str.
enumerated type
visibility modifiers
the DecimalFormat class
String (String str)
5. Expressed in a Java program with single quotes
initialize
string literal
character literal
promotion
6. Before you use a variable __________it
initialize
method declaration
string literal
Random class
7. sides=10;
java.lang package
assignment statement
escape sequences
assignment conversion
8. Returns true if the scanner has anotehr token in its input.
character literal
variable
java.util class libary
boolean hasNext( )
9. We use an object when we have a _________ to it
called method
return statement
static
reference
10. Two floating data types: float - _______
character string
string name;
import java.util*
double
11. Returns the character at the specified index.
pointer
Understanding
char charAt (int index)
not possible
12. 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.
instance variable
aliases
encapsulation
java.lang package
13. Instance data should be defined with what________ visibility
the DecimalFormat class
inheritance
String nextLine( )
private
14. Each piece of data that we send to a method
class
parameter
long
method
15. An object in Java - defined by the class String
character string
a constructor
String next( )
reserved word void
16. Part of the java.util class; picks a number at random out of a range of values.
method declaration
instantiation
String findInLine (String pattern)
Random class
17. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
parameter
variable
boolean equalsIgnoreCase (String str)
parentheses
18. Returns a new string consisting of this string concatenated with str.
method invocation
String concat (String str)
formal parameters
postfix form
19. Two categories of statements that control the flow of executing through a method: __________ and loops
conditional statement
conditionals
underscores
parameter list
20. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
underscores
service methods
attributes of an object
encapsulation
21. 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
long
enumerated type
service methods
a constructor
22. Constants are ______ because the can't be changed once you use the final modifier
import java.util*
state of an object
public
underscores
23. All wrapper classes are defined in ___________
data values
java.lang package
promotion
String format (double number)
24. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
initialize
local data
dot operator
self-governing
25. ______________ operators have higher precedence
polymorphism
arithmetic
enumerated type
String object
26. An object has behaviors - which are defined by the ________ associated with that object.
operations
actual parameters
accessor method
called method
27. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
constructors
autoboxing
int compareTo (String str)
String substring (int offset - int endIndex)
28. Boolean type conversions are ___________
declared
tokens
higher
not possible
29. Methods in the Math class are ______
byte to short
underscores
operations
static
30. Widening byte: _________ - to int - to long - to float - to double
attributes of an object
byte to short
pointer
visibility modifiers
31. 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
assignment conversion
class
instance data
32. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
java.lang package
parameter
assignment conversion
string name;
33. A variable that refers to an object must be __________
wrapper class
postfix form
instance data
declared
34. Variables that don't contain any data
encapsulation
static int parseInt (String str)
uninitialized variables
underscores
35. The names of the parameters in the header of the method declaration
support methods
formal parameters
service methods
String (String str)
36. Returns a new string consisting of this string concatenated with str.
return statement
postfix form
initialize
boolean equals (String str)
37. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
num=Integer.parseInt(str);
floating point numbers
operations
state of an object
38. This declaration creates a Scanner object that reads input from the keyboard
have void
class level
Scanner scan=new Scanner (System.in);
not possible
39. 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
class
static
variable declaration
assignment
40. 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
string name;
higher
parameter
boolean value
41. Returns the next input token as a character string.
postfix form
primitive variables
String object
String next( )
42. 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
null
a constructor
method invocation
method declaration
43. Variables and constants can be referenced in any method of the class by declaring at the _________
class level
instance data
variable
boolean value
44. All numeric types are _______ - meaning both positive and negative values can be stored in them
boolean value
instance data
byte to short
signed
45. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
return statement
long
String object
46. 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 invocation
encapsulation of an object
String findInLine (String pattern)
flow of control
47. ++count; -- count
prefix form
data values
string name;
set
48. They clarify the role a certain number has in the program.
data values
null
constants
attributes of an object
49. The one that is invoked
called method
assignment statement
byte to short
header of a method
50. 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.
self-governing
Scanner scan=new Scanner (System.in);
scope
instantiation