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. This declaration creates a Scanner object that reads input from the keyboard
encapsulation
Scanner scan=new Scanner (System.in);
int compareTo (String str)
class level
2. Expressed in a Java program with single quotes
operations
String findInLine (String pattern)
instance variable
character literal
3. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
boolean nextBoolean( )
double
floating point numbers
class library
4. A variable that refers to an object must be __________
byte nextByte( )
byte to short
char charAt (int index)
declared
5. 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.
String (String str)
polymorphism
int compareTo (String str)
reserved word void
6. ______________ operators have higher precedence
service methods
arithmetic
escape sequences
parameter
7. 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
state of an object
encapsulation
import java.util*
aliases
8. Sets the scanner's delimiting pattern.
instance data
Scanner useDelimiter(String pattern)
operations
delimiters
9. ____________ is instantiated in the traditional way using the new operator.
the DecimalFormat class
pointer
long
expression
10. 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
double
boolean nextBoolean( )
pointer
formal parameters
11. 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.
String toLowerCase ( )
boolean equalsIgnoreCase (String str)
encapsulation
prefix form
12. Changes a particular value - e.g.setX - where X is the value they are setting.
Understanding
variable
mutator method
NumberFormat class
13. Returns the int corresponding to the value stored in the specified string
static int parseInt (String str)
String (String str)
header of a method
initialize
14. A set of classes that supports the development of programs
have void
class library
flow of control
encapsulation
15. A null reference indicates that a variable does not refer to an object
signed
null
Scanner useDelimiter(String pattern)
accessor method
16. After an object has been instantiated - we set the _________ to access its methods
promotion
method invocation
dot operator
double
17. 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
System.out.println
private
enumerated type
18. Boolean type conversions are ___________
parameter
not possible
Understanding
class library
19. Returns the number of characters in this stirng.
int length( )
variable declaration
Scanner class
arithmetic
20. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
postfix form
parameter
accessor method
static
21. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
long
instance data
class level
22. The declarations of object variables have a similar structure to the declaration of _______________
primitive variables
constants
promotion
tokens
23. Constructor: creates a new pseudorandom number generator.
initialize
Random ( )
instance data
double
24. Two categories of statements that control the flow of executing through a method: __________ and loops
boolean equalsIgnoreCase (String str)
assignment statement
class library
conditionals
25. A name for a location in memory used to hold a data value.
not possible
System.out.println
visibility modifiers
variable
26. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
instance data
int compareTo (String str)
num=Integer.parseInt(str);
self-governing
27. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
floating point numbers
support methods
signed
the DecimalFormat class
28. The act of creating an object using the "new" operator
inheritance
instantiation
String next( )
method declaration
29. The automatic conversion between a primitive value and a corresponding wrapper object.
byte nextByte( )
dot operator
private
autoboxing
30. 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
flow of control
parentheses
String format (double number)
31. Begins with a backslash character ""
String replace (char oldChar - char newChar)
method
escape sequences
Random class
32. The idea that we can refer to multiple types of related objects over time in consistent ways. it gives us the ability to design powerful and elegant solutions to problems that deal with multiple objects.
Scanner useDelimiter(String pattern)
polymorphism
constructors
boolean equalsIgnoreCase (String str)
33. 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 equalsIgnoreCase (String str)
enumerated type
attributes of an object
self-governing
34. 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
variable declaration
underscores
tokens
string literal
35. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
java.lang package
state of an object
RH
String next( )
36. _____ expression evaluated first
visibility modifiers
private
method invocation
RH
37. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
expression
private
parentheses
assignment conversion
38. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
attributes of an object
Scanner scan=new Scanner (System.in);
behaviors of an object
private
39. All wrapper classes are defined in ___________
char charAt (int index)
String substring (int offset - int endIndex)
java.lang package
class
40. 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 -
String (String str)
self-governing
class
return statement
41. Modifier>type/void>identifier>parameters>method body
method declaration
static
data values
formal parameters
42. All numeric types are _______ - meaning both positive and negative values can be stored in them
signed
Scanner scan=new Scanner (System.in);
String (String str)
conditional statement
43. Count++; count--
escape sequences
instantiation
String (String str)
postfix form
44. A method that returns a value must have a _________
flow of control
higher
a constructor
return statement
45. Only two valid values: true and false; can indicate whether a particular condition is true - but can also be used to represent any situation that has two states - such as a light bulb being on or off
variable name
boolean value
postfix form
accessor method
46. The names of the parameters in the header of the method declaration
parameter
character string
formal parameters
instance data
47. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
the DecimalFormat class
inheritance
method invocation
48. Constants are ______ because the can't be changed once you use the final modifier
set
assignment statement
a constructor
public
49. 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
floating point numbers
mutator method
instance variable
50. 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:
assignment conversion
instantiation
string name;
num=Integer.parseInt(str);