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 order in which statements are executed in a running program
Scanner class
flow of control
Random ( )
the "import" declaration
2. ______________ operators have higher precedence
instance data
static
arithmetic
Scanner scan=new Scanner (System.in);
3. 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
boolean hasNext( )
Scanner useDelimiter(String pattern)
assignment statement
4. Part of the java.util class; picks a number at random out of a range of values.
Random class
not possible
import java.util*
java.lang package
5. 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
a constructor
accessor method
scope
the "import" declaration
6. The classes of the Java standard class library are grouped into __________.
have void
scope
Random class
packages
7. White space characters such as space characters - tabs - and new lines that separate the elements of input
declared
delimiters
local data
constants
8. The values passed into a method in an invocation; these are called the arguments to the method
a constructor
visibility modifiers
actual parameters
null
9. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
String concat (String str)
self-governing
boolean hasNext( )
private
10. Variables and constants can be referenced in any method of the class by declaring at the _________
static
conditionals
class level
boolean nextBoolean( )
11. Three ways in which Java conversions occur: _________ conversion - promotion - casting
Scanner class
visibility modifiers
boolean equals (String str)
assignment
12. 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 -
character string
class
underscores
return statement
13. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
formal parameters
prefix form
String replace (char oldChar - char newChar)
string literal
14. Expressed in a Java program with single quotes
the DecimalFormat class
variable
character literal
called method
15. All numeric types are _______ - meaning both positive and negative values can be stored in them
signed
parameter list
the "import" declaration
delimiters
16. Delimited by double quotation characters
class
signed
Scanner class
string literal
17. Returns true if the scanner has anotehr token in its input.
boolean hasNext( )
promotion
the DecimalFormat class
literal
18. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
java.lang package
Scanner class
literal
support methods
19. Methods in the Math class are ______
postfix form
static
support methods
data values
20. ____________ is instantiated in the traditional way using the new operator.
NumberFormat class
the DecimalFormat class
int compareTo (String str)
string name;
21. 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
behaviors of an object
method
signed
import java.util*
22. Returns a string containing the specified number formatted according to this object's pattern.
assignment conversion
arithmetic
String format (double number)
higher
23. 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.
the "import" declaration
assignment conversion
uninitialized variables
Random ( )
24. format for constants: all upper-case; separated by ________
RH
underscores
self-governing
instance variable
25. The declarations of object variables have a similar structure to the declaration of _______________
primitive variables
String substring (int offset - int endIndex)
accessor method
called method
26. Returns the character at the specified index.
the "import" declaration
promotion
byte to short
char charAt (int index)
27. Constructors do not even _______; therefore they cannot return a value.
promotion
not possible
a constructor
have void
28. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
Scanner useDelimiter(String pattern)
state of an object
parameter list
character literal
29. All wrapper classes are defined in ___________
java.lang package
boolean value
tokens
byte to short
30. 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
parameter
support methods
String format (double number)
pointer
31. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
String replace (char oldChar - char newChar)
variable
NumberFormat class
return statement
32. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
char charAt (int index)
inheritance
behaviors of an object
the DecimalFormat class
33. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
boolean value
attributes of an object
String substring (int offset - int endIndex)
class
34. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
import java.util*
self-governing
assignment statement
encapsulation
35. Cast operator has _________ precedence to division
Random ( )
higher
the "import" declaration
instance data
36. 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.
boolean equals (String str)
the "import" declaration
have void
enumerated type
37. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
Scanner class
int compareTo (String str)
set
instance data
38. Returns the next input token as a character string.
class
variable
the DecimalFormat class
String next( )
39. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
parentheses
String toUpperCase ( )
null
40. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
encapsulation of an object
casting
constructors
have void
41. Begins with a backslash character ""
byte to short
class level
flow of control
escape sequences
42. 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
System.out.println
parameter
actual parameters
43. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
boolean value
String concat (String str)
accessor method
character string
44. 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
String toUpperCase ( )
String object
method invocation
scope
45. Part of the standard Java class library - provides convenient methods for reading input values of various types. the input can come from various sources - including data typed interactively by the user or data stored in a file; the Scanner class can
instantiation
Scanner class
local data
java.util class libary
46. Elements of input
variable name
tokens
import java.util*
parentheses
47. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
parentheses
declared
service methods
promotion
48. When a variable is declared inside a method
local data
int compareTo (String str)
visibility modifiers
operations
49. Returns the next input token as the indicated type.
method declaration
byte nextByte( )
delimiters
reference
50. Constants are ______ because the can't be changed once you use the final modifier
instance data
String (String str)
Random ( )
public