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. 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.
assignment statement
scope
casting
higher
2. 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.
int length( )
parameter list
private
method
3. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
String replace (char oldChar - char newChar)
int compareTo (String str)
encapsulation of an object
System.out.println
4. Also called a selection statement b/c it allows us to choose which statement will be executed next.
conditional statement
java.lang package
parentheses
assignment
5. System.out object represents an output device or file; we send the println message to the System.out object to request that some text be printed
System.out.println
return statement
class library
instance variable
6. format for constants: all upper-case; separated by ________
underscores
String findInLine (String pattern)
conditional statement
java.lang package
7. 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
delimiters
encapsulation of an object
parameter
parameter
8. sides=10;
assignment
encapsulation
called method
assignment statement
9. 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)
String toLowerCase ( )
char charAt (int index)
prefix form
10. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
boolean equalsIgnoreCase (String str)
Scanner scan=new Scanner (System.in);
variable
method declaration
11. 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.
visibility modifiers
reference
enumerated type
constructors
12. Three ways in which Java conversions occur: _________ conversion - promotion - casting
String concat (String str)
assignment
constants
private
13. 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.
local data
assignment conversion
have void
String object
14. Changes a particular value - e.g.setX - where X is the value they are setting.
variable
accessor method
string name;
mutator method
15. 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.
Scanner useDelimiter(String pattern)
encapsulation
byte to short
formal parameters
16. 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
flow of control
string name;
casting
Scanner scan=new Scanner (System.in);
17. 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*
String (String str)
attributes of an object
actual parameters
18. Count++; count--
postfix form
boolean hasNext( )
Scanner useDelimiter(String pattern)
instantiation
19. Variables that don't contain any data
boolean equals (String str)
operations
uninitialized variables
state of an object
20. 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.
postfix form
boolean equals (String str)
reserved word void
num=Integer.parseInt(str);
21. Elements of input
static int parseInt (String str)
reserved word void
tokens
String (String str)
22. An object has behaviors - which are defined by the ________ associated with that object.
Scanner scan=new Scanner (System.in);
int length( )
parameter list
operations
23. A ________________ is immutable.
Understanding
expression
System.out.println
String object
24. The declarations of object variables have a similar structure to the declaration of _______________
int length( )
prefix form
primitive variables
java.lang package
25. Declared in a class but not inside any particular method
support methods
instance data
variable
method
26. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
wrapper class
static
delimiters
int compareTo (String str)
27. New memory space is reserved for that variable every time an instance of the class that is created.
instance data
reserved word void
aliases
prefix form
28. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
java.lang package
escape sequences
instance variable
Random ( )
29. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
enumerated type
promotion
wrapper class
dot operator
30. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
String next( )
header of a method
wrapper class
assignment
31. Constructors do not even _______; therefore they cannot return a value.
operations
have void
a constructor
self-governing
32. Returns the next input token as the indicated type.
have void
boolean nextBoolean( )
header of a method
num=Integer.parseInt(str);
33. Constructor: creates a new string object with the same characters as str.
String (String str)
reserved word void
variable name
string name;
34. 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 level
variable declaration
method
assignment
35. An explicit data value used in a program
assignment
literal
state of an object
polymorphism
36. ____________ is instantiated in the traditional way using the new operator.
wrapper class
private
byte nextByte( )
the DecimalFormat class
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
Scanner scan=new Scanner (System.in);
String format (double number)
method
string literal
38. Constructor: creates a new pseudorandom number generator.
self-governing
String findInLine (String pattern)
Random ( )
boolean equals (String str)
39. 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
variable
inheritance
byte to short
support methods
40. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
service methods
String substring (int offset - int endIndex)
mutator method
41. ______________ operators have higher precedence
arithmetic
initialize
dot operator
Scanner class
42. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
casting
import java.util*
boolean nextBoolean( )
operations
43. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
String concat (String str)
packages
double
instance variable
44. _____ expression evaluated first
expression
RH
attributes of an object
instance data
45. 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.
polymorphism
class
underscores
aliases
46. The names of the parameters in the header of the method declaration
string name;
the "import" declaration
formal parameters
postfix form
47. Control access to the members of a class. the reserved words public and private are visibility modifiers that can be applied to the variables and methods of a class.
visibility modifiers
literal
header of a method
String replace (char oldChar - char newChar)
48. Sets the scanner's delimiting pattern.
int compareTo (String str)
assignment
Scanner useDelimiter(String pattern)
a constructor
49. Before you use a variable __________it
String concat (String str)
instance data
initialize
flow of control
50. 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
primitive variables
String object
aliases
the DecimalFormat class