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. New memory space is reserved for that variable every time an instance of the class that is created.
mutator method
instance data
conditional statement
null
2. Represents either a primitive value or an object
variable name
java.util class libary
instantiation
import java.util*
3. Two floating data types: float - _______
num=Integer.parseInt(str);
java.lang package
double
assignment conversion
4. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
String substring (int offset - int endIndex)
Random class
operations
5. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
floating point numbers
long
escape sequences
6. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
mutator method
the DecimalFormat class
self-governing
parameter
7. 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.
enumerated type
assignment statement
string literal
import java.util*
8. The classes of the Java standard class library are grouped into __________.
packages
String toUpperCase ( )
long
declared
9. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
Scanner scan=new Scanner (System.in);
flow of control
tokens
10. Returns the character at the specified index.
public
char charAt (int index)
method
set
11. Returns a new string consisting of this string concatenated with str.
casting
String concat (String str)
private
uninitialized variables
12. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
NumberFormat class
declared
method invocation
casting
13. Boolean type conversions are ___________
method declaration
import java.util*
not possible
wrapper class
14. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
Understanding
self-governing
service methods
class library
15. Part of the java.util class; picks a number at random out of a range of values.
Random class
char charAt (int index)
mutator method
parameter
16. A value that is passed into a method when it is invoked
parameter
String format (double number)
reserved word void
support methods
17. White space characters such as space characters - tabs - and new lines that separate the elements of input
RH
prefix form
java.lang package
delimiters
18. When a variable is declared inside a method
local data
num=Integer.parseInt(str);
inheritance
mutator method
19. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
encapsulation
String replace (char oldChar - char newChar)
literal
boolean nextBoolean( )
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
dot operator
variable declaration
reference
underscores
21. Constructors do not even _______; therefore they cannot return a value.
parameter
character string
have void
self-governing
22. Constructor: creates a new string object with the same characters as str.
java.util class libary
String (String str)
operations
dot operator
23. The one that is invoked
String toLowerCase ( )
called method
parentheses
null
24. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
tokens
pointer
instance variable
conditionals
25. 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
tokens
String nextLine( )
boolean equals (String str)
26. A name for a location in memory used to hold a data value.
a constructor
autoboxing
variable
enumerated type
27. The values passed into a method in an invocation; these are called the arguments to the method
actual parameters
instantiation
String concat (String str)
promotion
28. All wrapper classes are defined in ___________
long
num=Integer.parseInt(str);
java.lang package
double
29. This declaration creates a Scanner object that reads input from the keyboard
tokens
declared
the "import" declaration
Scanner scan=new Scanner (System.in);
30. The declarations of object variables have a similar structure to the declaration of _______________
boolean equalsIgnoreCase (String str)
autoboxing
data values
primitive variables
31. Methods in the Math class are ______
static
postfix form
static int parseInt (String str)
the "import" declaration
32. 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.
assignment conversion
assignment
parameter list
not possible
33. Modifier>type/void>identifier>parameters>method body
method declaration
java.util class libary
autoboxing
method
34. 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
method
constructors
service methods
actual parameters
35. Sets the scanner's delimiting pattern.
inheritance
operations
string literal
Scanner useDelimiter(String pattern)
36. 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.
reserved word void
NumberFormat class
pointer
actual parameters
37. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
not possible
int compareTo (String str)
support methods
String toLowerCase ( )
38. sides=10;
expression
assignment statement
conditionals
aliases
39. Expressed in a Java program with single quotes
character literal
character string
signed
assignment conversion
40. Widening byte: _________ - to int - to long - to float - to double
arithmetic
byte to short
string literal
have void
41. Returns the next input token as a character string.
underscores
encapsulation
inheritance
String next( )
42. Returns the number of characters in this stirng.
java.lang package
int length( )
String substring (int offset - int endIndex)
string literal
43. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
parentheses
String next( )
Understanding
delimiters
44. Before you use a variable __________it
String replace (char oldChar - char newChar)
String findInLine (String pattern)
String nextLine( )
initialize
45. 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.
state of an object
encapsulation
String nextLine( )
NumberFormat class
46. The act of creating an object using the "new" operator
instantiation
the DecimalFormat class
boolean value
String (String str)
47. ______________ operators have higher precedence
wrapper class
string literal
casting
arithmetic
48. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
header of a method
assignment
self-governing
Scanner useDelimiter(String pattern)
49. Returns a new string consisting of this string concatenated with str.
expression
boolean equals (String str)
import java.util*
attributes of an object
50. 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
NumberFormat class
String toUpperCase ( )
expression