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. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
reference
String replace (char oldChar - char newChar)
class library
2. White space characters such as space characters - tabs - and new lines that separate the elements of input
aliases
delimiters
pointer
literal
3. Before you use a variable __________it
postfix form
initialize
java.util class libary
Scanner scan=new Scanner (System.in);
4. A ________________ is immutable.
called method
method
String next( )
String object
5. An object has behaviors - which are defined by the ________ associated with that object.
operations
postfix form
promotion
casting
6. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
operations
assignment conversion
String replace (char oldChar - char newChar)
parameter
7. This declaration creates a Scanner object that reads input from the keyboard
String substring (int offset - int endIndex)
Scanner class
conditional statement
Scanner scan=new Scanner (System.in);
8. 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
Random ( )
public
primitive variables
aliases
9. Returns a new string consisting of this string concatenated with str.
casting
boolean equals (String str)
double
Random ( )
10. Delimited by double quotation characters
String findInLine (String pattern)
called method
encapsulation of an object
string literal
11. Changes a particular value - e.g.setX - where X is the value they are setting.
flow of control
mutator method
aliases
encapsulation
12. Every object has two things: a state and a _____ of behaviors
set
variable declaration
Random ( )
String substring (int offset - int endIndex)
13. 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
static
method invocation
not possible
local data
14. A set of classes that supports the development of programs
class library
static int parseInt (String str)
underscores
String format (double number)
15. Boolean type conversions are ___________
dot operator
not possible
flow of control
signed
16. 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
String format (double number)
initialize
method
17. 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
NumberFormat class
method invocation
pointer
conditional statement
18. Also called a selection statement b/c it allows us to choose which statement will be executed next.
method declaration
long
conditional statement
behaviors of an object
19. The Scanner class is part of ___________________
reserved word void
autoboxing
java.util class libary
Random ( )
20. Widening byte: _________ - to int - to long - to float - to double
String object
byte to short
tokens
encapsulation
21. 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.
aliases
String format (double number)
parameter list
private
22. sides=10;
static
assignment statement
mutator method
String object
23. 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.
boolean equalsIgnoreCase (String str)
aliases
variable declaration
polymorphism
24. Returns the next input token as the indicated type.
boolean nextBoolean( )
java.lang package
instance data
instantiation
25. 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
num=Integer.parseInt(str);
encapsulation of an object
scope
parameter
26. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
RH
local data
self-governing
floating point numbers
27. Elements of input
tokens
boolean hasNext( )
assignment
conditionals
28. Methods in the Math class are ______
higher
static
String substring (int offset - int endIndex)
aliases
29. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
expression
promotion
parameter list
prefix form
30. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
primitive variables
RH
actual parameters
31. 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
parentheses
string name;
delimiters
pointer
32. format for constants: all upper-case; separated by ________
instance data
higher
underscores
reserved word void
33. 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.
reserved word void
parentheses
enumerated type
static
34. Returns a new string consisting of this string concatenated with str.
initialize
String concat (String str)
support methods
set
35. Four integer data types: byte - short - int - _____
conditionals
long
higher
scope
36. 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
java.util class libary
method
import java.util*
parameter
37. 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:
boolean equalsIgnoreCase (String str)
String findInLine (String pattern)
uninitialized variables
num=Integer.parseInt(str);
38. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
private
packages
literal
state of an object
39. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
escape sequences
NumberFormat class
delimiters
behaviors of an object
40. An explicit data value used in a program
literal
boolean nextBoolean( )
pointer
state of an object
41. A class usually provides services to access and modify __________
method invocation
class level
parentheses
data values
42. Begins with a backslash character ""
escape sequences
packages
assignment
wrapper class
43. They clarify the role a certain number has in the program.
int length( )
constants
floating point numbers
promotion
44. All numeric types are _______ - meaning both positive and negative values can be stored in them
static
postfix form
signed
class library
45. Returns all input remaining on the current line as a character string.
visibility modifiers
higher
private
String nextLine( )
46. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
Scanner useDelimiter(String pattern)
parameter
constructors
instance variable
47. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
have void
boolean equalsIgnoreCase (String str)
System.out.println
variable declaration
48. Part of the java.util class; picks a number at random out of a range of values.
boolean equalsIgnoreCase (String str)
String replace (char oldChar - char newChar)
Random class
NumberFormat class
49. 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
public
conditional statement
class library
a constructor
50. 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.
class library
higher
flow of control
reserved word void