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
flow of control
parameter
arithmetic
accessor method
2. 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
expression
attributes of an object
long
Scanner scan=new Scanner (System.in);
3. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
Understanding
string name;
postfix form
NumberFormat class
4. 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.
String findInLine (String pattern)
Scanner useDelimiter(String pattern)
set
scope
5. 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.
floating point numbers
public
encapsulation of an object
enumerated type
6. They clarify the role a certain number has in the program.
boolean value
floating point numbers
String format (double number)
constants
7. 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
variable name
escape sequences
a constructor
8. The declarations of object variables have a similar structure to the declaration of _______________
assignment conversion
num=Integer.parseInt(str);
primitive variables
NumberFormat class
9. 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
attributes of an object
String next( )
declared
method
10. We use an object when we have a _________ to it
reference
local data
String format (double number)
variable
11. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
int compareTo (String str)
parameter
string literal
self-governing
12. Expressed in a Java program with single quotes
character literal
postfix form
Scanner scan=new Scanner (System.in);
conditional statement
13. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
variable
variable name
floating point numbers
arithmetic
14. Widening byte: _________ - to int - to long - to float - to double
signed
byte to short
reserved word void
constants
15. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
static
declared
self-governing
16. All wrapper classes are defined in ___________
data values
packages
int compareTo (String str)
java.lang package
17. White space characters such as space characters - tabs - and new lines that separate the elements of input
delimiters
assignment
constructors
boolean hasNext( )
18. Each piece of data that we send to a method
num=Integer.parseInt(str);
polymorphism
parameter
set
19. Constructor: creates a new pseudorandom number generator.
Random ( )
operations
aliases
delimiters
20. Declared in a class but not inside any particular method
String concat (String str)
operations
instance data
import java.util*
21. A value that is passed into a method when it is invoked
parameter
int compareTo (String str)
declared
return statement
22. Two floating data types: float - _______
java.util class libary
String toUpperCase ( )
double
String object
23. Returns the number of characters in this stirng.
int length( )
String (String str)
constants
dot operator
24. Constructors do not even _______; therefore they cannot return a value.
variable declaration
have void
enumerated type
mutator method
25. Part of the java.util class; picks a number at random out of a range of values.
Random class
higher
assignment
attributes of an object
26. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
header of a method
dot operator
variable name
int compareTo (String str)
27. All numeric types are _______ - meaning both positive and negative values can be stored in them
instance variable
num=Integer.parseInt(str);
signed
String nextLine( )
28. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
System.out.println
String (String str)
instance variable
attributes of an object
29. 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
String substring (int offset - int endIndex)
encapsulation of an object
public
reference
30. Cast operator has _________ precedence to division
set
String nextLine( )
higher
encapsulation of an object
31. ______________ operators have higher precedence
reserved word void
arithmetic
assignment
java.lang package
32. Returns the next input token as a character string.
parameter list
String next( )
boolean nextBoolean( )
string literal
33. Returns all input remaining on the current line as a character string.
formal parameters
java.lang package
public
String nextLine( )
34. 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
String replace (char oldChar - char newChar)
assignment conversion
boolean equalsIgnoreCase (String str)
wrapper class
35. 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.
flow of control
parameter list
character string
literal
36. 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
prefix form
encapsulation
class level
inheritance
37. 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
dot operator
character string
the DecimalFormat class
38. 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
java.lang package
literal
flow of control
Scanner class
39. Count++; count--
byte nextByte( )
postfix form
dot operator
prefix form
40. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
boolean value
import java.util*
parentheses
support methods
41. When a variable is declared inside a method
expression
Understanding
local data
char charAt (int index)
42. 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 -
class
encapsulation
int length( )
method declaration
43. Instance data should be defined with what________ visibility
private
declared
boolean hasNext( )
attributes of an object
44. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
String toLowerCase ( )
constructors
Scanner class
Scanner scan=new Scanner (System.in);
45. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
import java.util*
escape sequences
have void
operations
46. An object in Java - defined by the class String
String toLowerCase ( )
instance data
character string
String format (double number)
47. Represents either a primitive value or an object
flow of control
variable name
Scanner useDelimiter(String pattern)
packages
48. A name for a location in memory used to hold a data value.
visibility modifiers
inheritance
variable
constants
49. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
byte nextByte( )
reserved word void
support methods
Random class
50. A ________________ is immutable.
String object
wrapper class
method
initialize