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. Returns a string containing the specified number formatted according to this object's pattern.
class
String replace (char oldChar - char newChar)
String format (double number)
Scanner useDelimiter(String pattern)
2. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
character literal
service methods
expression
prefix form
3. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
encapsulation of an object
String substring (int offset - int endIndex)
prefix form
support methods
4. 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
the DecimalFormat class
wrapper class
state of an object
5. A class usually provides services to access and modify __________
data values
mutator method
service methods
num=Integer.parseInt(str);
6. Widening byte: _________ - to int - to long - to float - to double
declared
parameter
byte to short
constants
7. 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:
a constructor
String replace (char oldChar - char newChar)
num=Integer.parseInt(str);
char charAt (int index)
8. 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.
primitive variables
variable declaration
tokens
enumerated type
9. Constructors do not even _______; therefore they cannot return a value.
parameter
character literal
have void
public
10. 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
method
import java.util*
method invocation
11. ++count; -- count
String toLowerCase ( )
enumerated type
set
prefix form
12. 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.
service methods
static int parseInt (String str)
reserved word void
boolean hasNext( )
13. _____ expression evaluated first
RH
enumerated type
NumberFormat class
java.lang package
14. 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
not possible
aliases
class library
method invocation
15. All wrapper classes are defined in ___________
reference
String toUpperCase ( )
java.lang package
parameter
16. 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
conditionals
private
boolean hasNext( )
17. A null reference indicates that a variable does not refer to an object
static
String nextLine( )
null
arithmetic
18. Five steps of problem-solving: ____________ the problem - Designing a solution - Considering alternatives to the solution and refining the solution - Implementing the solution - Testing the solution and fixing any problems that exist
Understanding
class level
method declaration
enumerated type
19. Three ways in which Java conversions occur: _________ conversion - promotion - casting
character string
constructors
assignment
encapsulation
20. After an object has been instantiated - we set the _________ to access its methods
support methods
state of an object
tokens
dot operator
21. Returns true if the scanner has anotehr token in its input.
boolean hasNext( )
header of a method
have void
class level
22. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
actual parameters
num=Integer.parseInt(str);
header of a method
delimiters
23. Constructor: creates a new pseudorandom number generator.
self-governing
Random ( )
java.lang package
Scanner scan=new Scanner (System.in);
24. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
private
System.out.println
boolean value
25. Instance data should be defined with what________ visibility
packages
visibility modifiers
encapsulation of an object
private
26. 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
attributes of an object
variable
static
initialize
27. Returns the next input token as a character string.
called method
String next( )
class level
not possible
28. ______________ operators have higher precedence
formal parameters
arithmetic
inheritance
Random class
29. Represents either a primitive value or an object
tokens
null
conditional statement
variable name
30. 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
static int parseInt (String str)
Scanner class
not possible
Scanner useDelimiter(String pattern)
31. Constructor: creates a new string object with the same characters as str.
static int parseInt (String str)
self-governing
String (String str)
Random class
32. A value that is passed into a method when it is invoked
parameter
state of an object
double
string literal
33. Variables that don't contain any data
visibility modifiers
assignment conversion
uninitialized variables
String toLowerCase ( )
34. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
constructors
actual parameters
java.util class libary
instantiation
35. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
formal parameters
String toLowerCase ( )
java.lang package
class
36. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
autoboxing
parentheses
packages
support methods
37. Also called a selection statement b/c it allows us to choose which statement will be executed next.
conditional statement
flow of control
java.lang package
attributes of an object
38. 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.
parameter list
escape sequences
public
Scanner class
39. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
promotion
conditional statement
instance variable
prefix form
40. Returns all input remaining on the current line as a character string.
String nextLine( )
actual parameters
method
boolean equalsIgnoreCase (String str)
41. Methods in the Math class are ______
double
static
conditional statement
String toLowerCase ( )
42. A combo of one or more operators and operands that usually perform a calculation; operands can be literals - constants - variables - or other sources of data
expression
String next( )
boolean equals (String str)
data values
43. Changes a particular value - e.g.setX - where X is the value they are setting.
mutator method
boolean nextBoolean( )
NumberFormat class
postfix form
44. 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.
encapsulation of an object
assignment conversion
formal parameters
method
45. sides=10;
byte nextByte( )
byte to short
assignment statement
pointer
46. The declarations of object variables have a similar structure to the declaration of _______________
behaviors of an object
primitive variables
String substring (int offset - int endIndex)
String findInLine (String pattern)
47. Before you use a variable __________it
accessor method
initialize
parameter
Scanner useDelimiter(String pattern)
48. White space characters such as space characters - tabs - and new lines that separate the elements of input
double
tokens
delimiters
escape sequences
49. Every object has two things: a state and a _____ of behaviors
set
import java.util*
assignment conversion
postfix form
50. 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.
conditionals
class level
scope
postfix form