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
arithmetic
System.out.println
method
set
2. A variable that refers to an object must be __________
conditionals
encapsulation
String concat (String str)
declared
3. Occurs when a value of one type is assigned to a variable of another type during which the value is converted to the new type.
parameter list
promotion
double
assignment conversion
4. Returns a new string consisting of this string concatenated with str.
class library
boolean equals (String str)
uninitialized variables
String next( )
5. Cast operator has _________ precedence to division
assignment statement
public
higher
boolean hasNext( )
6. Modifier>type/void>identifier>parameters>method body
parameter
reserved word void
method declaration
accessor method
7. ____________ is instantiated in the traditional way using the new operator.
NumberFormat class
the DecimalFormat class
String format (double number)
instance data
8. format for constants: all upper-case; separated by ________
tokens
reference
not possible
underscores
9. 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
expression
int length( )
method invocation
byte nextByte( )
10. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
encapsulation
visibility modifiers
packages
String toLowerCase ( )
11. 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
aliases
primitive variables
mutator method
Understanding
12. 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
String replace (char oldChar - char newChar)
Scanner class
expression
literal
13. Each piece of data that we send to a method
null
operations
pointer
parameter
14. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
behaviors of an object
return statement
not possible
prefix form
15. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
declared
boolean equalsIgnoreCase (String str)
int length( )
boolean equals (String str)
16. An explicit data value used in a program
parameter
promotion
literal
conditionals
17. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
import java.util*
pointer
method declaration
instance variable
18. Widening byte: _________ - to int - to long - to float - to double
reference
byte to short
conditional statement
boolean equals (String str)
19. ++count; -- count
prefix form
encapsulation of an object
return statement
pointer
20. 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:
num=Integer.parseInt(str);
NumberFormat class
encapsulation of an object
higher
21. Before you use a variable __________it
String replace (char oldChar - char newChar)
uninitialized variables
static int parseInt (String str)
initialize
22. _____ expression evaluated first
RH
delimiters
variable name
method invocation
23. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
higher
class
a constructor
NumberFormat class
24. A set of classes that supports the development of programs
class library
String object
data values
autoboxing
25. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
accessor method
method
reserved word void
26. 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.
set
scope
enumerated type
boolean hasNext( )
27. The names of the parameters in the header of the method declaration
formal parameters
char charAt (int index)
service methods
instance variable
28. After an object has been instantiated - we set the _________ to access its methods
parentheses
dot operator
num=Integer.parseInt(str);
variable name
29. Returns all input remaining on the current line as a character string.
constants
parameter
String nextLine( )
assignment statement
30. Every object has two things: a state and a _____ of behaviors
boolean nextBoolean( )
assignment statement
set
Scanner class
31. Four integer data types: byte - short - int - _____
long
method declaration
class
String toLowerCase ( )
32. Returns the int corresponding to the value stored in the specified string
parameter list
encapsulation of an object
static int parseInt (String str)
inheritance
33. Boolean type conversions are ___________
dot operator
not possible
String toLowerCase ( )
escape sequences
34. The idea that we can refer to multiple types of related objects over time in consistent ways. it gives us the ability to design powerful and elegant solutions to problems that deal with multiple objects.
prefix form
initialize
polymorphism
conditionals
35. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
inheritance
autoboxing
header of a method
class
36. An object in Java - defined by the class String
aliases
character string
string name;
not possible
37. Elements of input
String toLowerCase ( )
parameter
reference
tokens
38. 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
import java.util*
initialize
attributes of an object
System.out.println
39. The order in which statements are executed in a running program
System.out.println
flow of control
character string
String next( )
40. They clarify the role a certain number has in the program.
casting
NumberFormat class
Random ( )
constants
41. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
expression
byte nextByte( )
service methods
boolean nextBoolean( )
42. A name for a location in memory used to hold a data value.
character literal
actual parameters
variable
polymorphism
43. The Scanner class is part of ___________________
java.util class libary
instantiation
expression
assignment statement
44. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
have void
String substring (int offset - int endIndex)
floating point numbers
declared
45. Attempts to find the next occurence of the specified pattern - ignoring delimiters
assignment
instance data
String findInLine (String pattern)
String nextLine( )
46. 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 -
static int parseInt (String str)
literal
class
autoboxing
47. Begins with a backslash character ""
higher
String nextLine( )
escape sequences
casting
48. 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
higher
assignment statement
num=Integer.parseInt(str);
inheritance
49. The values passed into a method in an invocation; these are called the arguments to the method
static int parseInt (String str)
conditional statement
return statement
actual parameters
50. Two categories of statements that control the flow of executing through a method: __________ and loops
long
variable declaration
conditionals
RH