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. 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.
method declaration
method invocation
parameter list
scope
2. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
escape sequences
state of an object
private
instance data
3. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
long
promotion
private
num=Integer.parseInt(str);
4. Variables and constants can be referenced in any method of the class by declaring at the _________
NumberFormat class
class level
boolean equalsIgnoreCase (String str)
null
5. The automatic conversion between a primitive value and a corresponding wrapper object.
class level
Random class
autoboxing
floating point numbers
6. 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
java.lang package
return statement
parameter
7. An object in Java - defined by the class String
character string
variable name
parameter list
reference
8. The order in which statements are executed in a running program
flow of control
underscores
Scanner useDelimiter(String pattern)
constants
9. The names of the parameters in the header of the method declaration
class
formal parameters
method invocation
assignment
10. Attempts to find the next occurence of the specified pattern - ignoring delimiters
casting
instance variable
String findInLine (String pattern)
accessor method
11. Specifies the packages and classes that will be used in a program so that the fully qualified name is not necessary with each reference.
variable name
prefix form
aliases
the "import" declaration
12. Returns the character at the specified index.
Random class
boolean nextBoolean( )
char charAt (int index)
prefix form
13. The one that is invoked
encapsulation
assignment statement
String toUpperCase ( )
called method
14. Provide various methods related to the management of the associated primitive type. Used when we create an object that serves as a container to hold various types of other objects - and we want the object to hold a simple integer value. In this case
instantiation
actual parameters
import java.util*
wrapper class
15. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
constructors
delimiters
assignment conversion
autoboxing
16. Also called a selection statement b/c it allows us to choose which statement will be executed next.
int compareTo (String str)
conditional statement
tokens
visibility modifiers
17. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
String findInLine (String pattern)
String substring (int offset - int endIndex)
service methods
accessor method
18. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
character literal
local data
java.lang package
19. Cast operator has _________ precedence to division
higher
reserved word void
have void
state of an object
20. All wrapper classes are defined in ___________
escape sequences
literal
prefix form
java.lang package
21. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
return statement
method
assignment
22. Returns the next input token as a character string.
flow of control
arithmetic
String next( )
assignment conversion
23. Instance data should be defined with what________ visibility
RH
character literal
java.lang package
private
24. Returns the next input token as the indicated type.
byte nextByte( )
arithmetic
expression
parameter
25. ++count; -- count
return statement
packages
enumerated type
prefix form
26. Variables that don't contain any data
formal parameters
character literal
uninitialized variables
instance data
27. Returns true if the scanner has anotehr token in its input.
formal parameters
boolean hasNext( )
promotion
char charAt (int index)
28. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
NumberFormat class
variable declaration
formal parameters
String replace (char oldChar - char newChar)
29. A variable that refers to an object must be __________
declared
initialize
enumerated type
Understanding
30. 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
Random class
state of an object
attributes of an object
arithmetic
31. Two categories of statements that control the flow of executing through a method: __________ and loops
int compareTo (String str)
instantiation
conditionals
string literal
32. 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
parameter
encapsulation of an object
method invocation
String toLowerCase ( )
33. 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
encapsulation
instance data
Understanding
service methods
34. A class usually provides services to access and modify __________
mutator method
string name;
data values
double
35. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
delimiters
instance data
have void
36. 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
escape sequences
boolean equalsIgnoreCase (String str)
long
37. Begins with a backslash character ""
escape sequences
Random class
method declaration
initialize
38. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
String object
string literal
parameter
accessor method
39. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
conditionals
parameter
String substring (int offset - int endIndex)
character string
40. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
set
accessor method
character literal
String replace (char oldChar - char newChar)
41. They clarify the role a certain number has in the program.
String (String str)
postfix form
constants
actual parameters
42. Methods in the Math class are ______
String toUpperCase ( )
static
higher
int compareTo (String str)
43. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
String object
boolean equalsIgnoreCase (String str)
RH
higher
44. Widening byte: _________ - to int - to long - to float - to double
return statement
byte to short
String replace (char oldChar - char newChar)
polymorphism
45. A Java operator that is specified by a type name in parentheses; truncates rather than rounds; useful in division if u want an integer to be treated as a float or double
signed
not possible
casting
encapsulation
46. The declarations of object variables have a similar structure to the declaration of _______________
state of an object
String (String str)
primitive variables
method
47. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
called method
public
String concat (String str)
48. All numeric types are _______ - meaning both positive and negative values can be stored in them
instance data
signed
Scanner class
NumberFormat class
49. 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
public
method invocation
assignment conversion
String format (double number)
50. Four integer data types: byte - short - int - _____
declared
enumerated type
state of an object
long