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. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
header of a method
int compareTo (String str)
behaviors of an object
boolean nextBoolean( )
2. 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.
scope
variable name
postfix form
System.out.println
3. An object has behaviors - which are defined by the ________ associated with that object.
set
declared
operations
flow of control
4. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
inheritance
class
Random class
String toLowerCase ( )
5. After an object has been instantiated - we set the _________ to access its methods
casting
String toLowerCase ( )
dot operator
conditionals
6. Returns the next input token as the indicated type.
boolean nextBoolean( )
int length( )
formal parameters
attributes of an object
7. The names of the parameters in the header of the method declaration
parameter
boolean equals (String str)
formal parameters
constants
8. Returns all input remaining on the current line as a character string.
variable declaration
declared
private
String nextLine( )
9. The one that is invoked
called method
flow of control
the DecimalFormat class
byte nextByte( )
10. A variable that refers to an object must be __________
java.util class libary
enumerated type
declared
assignment
11. Returns the number of characters in this stirng.
int length( )
escape sequences
constants
aliases
12. Constructor: creates a new pseudorandom number generator.
String format (double number)
instance data
string name;
Random ( )
13. 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
mutator method
tokens
attributes of an object
class
14. 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)
RH
initialize
higher
15. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
attributes of an object
header of a method
String toLowerCase ( )
boolean equalsIgnoreCase (String str)
16. Returns a new string consisting of this string concatenated with str.
tokens
NumberFormat class
String concat (String str)
a constructor
17. Part of the java.util class; picks a number at random out of a range of values.
static
Random class
behaviors of an object
parentheses
18. 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
initialize
long
method
primitive variables
19. A name for a location in memory used to hold a data value.
String findInLine (String pattern)
Random class
Scanner scan=new Scanner (System.in);
variable
20. 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
higher
initialize
String toUpperCase ( )
variable declaration
21. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
casting
wrapper class
instance variable
character literal
22. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
pointer
NumberFormat class
conditional statement
int length( )
23. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
class
instance variable
String toUpperCase ( )
24. 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
assignment statement
char charAt (int index)
boolean equals (String str)
encapsulation of an object
25. Constructors do not even _______; therefore they cannot return a value.
have void
declared
instance variable
string literal
26. A null reference indicates that a variable does not refer to an object
null
support methods
attributes of an object
state of an object
27. Constructor: creates a new string object with the same characters as str.
set
visibility modifiers
the "import" declaration
String (String str)
28. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
escape sequences
String replace (char oldChar - char newChar)
floating point numbers
a constructor
29. 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
flow of control
expression
aliases
operations
30. Instance data should be defined with what________ visibility
private
wrapper class
formal parameters
long
31. 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
method invocation
NumberFormat class
character literal
parameter
32. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
operations
Random class
Scanner class
33. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
String nextLine( )
enumerated type
self-governing
character string
34. sides=10;
Scanner scan=new Scanner (System.in);
assignment statement
packages
private
35. 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
java.lang package
RH
System.out.println
actual parameters
36. Attempts to find the next occurence of the specified pattern - ignoring delimiters
parameter
int compareTo (String str)
String findInLine (String pattern)
parentheses
37. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
behaviors of an object
String substring (int offset - int endIndex)
String format (double number)
conditional statement
38. Expressed in a Java program with single quotes
self-governing
character literal
Scanner useDelimiter(String pattern)
set
39. The act of creating an object using the "new" operator
visibility modifiers
instantiation
encapsulation of an object
actual parameters
40. Four integer data types: byte - short - int - _____
instantiation
long
variable name
boolean nextBoolean( )
41. 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 -
class
method declaration
a constructor
not possible
42. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
String toUpperCase ( )
delimiters
attributes of an object
assignment
43. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
instance data
reserved word void
encapsulation of an object
44. The automatic conversion between a primitive value and a corresponding wrapper object.
actual parameters
declared
postfix form
autoboxing
45. White space characters such as space characters - tabs - and new lines that separate the elements of input
variable declaration
String (String str)
visibility modifiers
delimiters
46. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
reference
state of an object
accessor method
String concat (String str)
47. Returns a string containing the specified number formatted according to this object's pattern.
assignment conversion
String format (double number)
Understanding
reserved word void
48. 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
double
prefix form
assignment
49. We use an object when we have a _________ to it
reference
character literal
String replace (char oldChar - char newChar)
double
50. ++count; -- count
variable declaration
assignment statement
character literal
prefix form