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. 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:
dot operator
num=Integer.parseInt(str);
character string
tokens
2. ++count; -- count
conditionals
prefix form
byte nextByte( )
parameter list
3. 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
Scanner class
set
class
operations
4. The declarations of object variables have a similar structure to the declaration of _______________
String format (double number)
primitive variables
assignment statement
Random class
5. This declaration creates a Scanner object that reads input from the keyboard
higher
escape sequences
signed
Scanner scan=new Scanner (System.in);
6. Cast operator has _________ precedence to division
higher
string literal
return statement
java.lang package
7. format for constants: all upper-case; separated by ________
underscores
operations
NumberFormat class
Random ( )
8. 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
parameter
method invocation
method
variable name
9. 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
casting
behaviors of an object
actual parameters
assignment
10. The act of creating an object using the "new" operator
a constructor
Scanner useDelimiter(String pattern)
class
instantiation
11. A class usually provides services to access and modify __________
arithmetic
visibility modifiers
behaviors of an object
data values
12. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
operations
string name;
promotion
Understanding
13. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
operations
aliases
int compareTo (String str)
String findInLine (String pattern)
14. Constructors do not even _______; therefore they cannot return a value.
scope
parameter
have void
static int parseInt (String str)
15. Elements of input
public
tokens
attributes of an object
private
16. 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.
encapsulation
assignment
String toUpperCase ( )
class
17. Returns the next input token as the indicated type.
boolean nextBoolean( )
Random ( )
wrapper class
initialize
18. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
self-governing
scope
String toLowerCase ( )
attributes of an object
19. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
parameter
floating point numbers
operations
class
20. Represents either a primitive value or an object
String format (double number)
class
variable name
operations
21. A ________________ is immutable.
String object
instance variable
method
String replace (char oldChar - char newChar)
22. 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
header of a method
inheritance
import java.util*
Scanner scan=new Scanner (System.in);
23. Constants are ______ because the can't be changed once you use the final modifier
enumerated type
reference
double
public
24. We use an object when we have a _________ to it
initialize
reference
behaviors of an object
constructors
25. 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.
String format (double number)
visibility modifiers
instance variable
wrapper class
26. New memory space is reserved for that variable every time an instance of the class that is created.
instance data
String (String str)
private
casting
27. Returns a new string consisting of this string concatenated with str.
aliases
String concat (String str)
java.lang package
enumerated type
28. All numeric types are _______ - meaning both positive and negative values can be stored in them
signed
num=Integer.parseInt(str);
null
method declaration
29. Also called a selection statement b/c it allows us to choose which statement will be executed next.
private
char charAt (int index)
conditional statement
Scanner scan=new Scanner (System.in);
30. Two categories of statements that control the flow of executing through a method: __________ and loops
dot operator
pointer
conditionals
int length( )
31. Constructor: creates a new string object with the same characters as str.
parameter list
variable name
String (String str)
boolean equals (String str)
32. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
int compareTo (String str)
string literal
support methods
have void
33. Returns the number of characters in this stirng.
String concat (String str)
double
int length( )
string literal
34. When a variable is declared inside a method
static
parentheses
prefix form
local data
35. Expressed in a Java program with single quotes
encapsulation of an object
variable
character literal
not possible
36. 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
local data
attributes of an object
state of an object
reference
37. The names of the parameters in the header of the method declaration
System.out.println
formal parameters
NumberFormat class
Scanner scan=new Scanner (System.in);
38. The one that is invoked
Scanner class
uninitialized variables
wrapper class
called method
39. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
NumberFormat class
arithmetic
character string
reserved word void
40. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
int length( )
a constructor
byte nextByte( )
41. Changes a particular value - e.g.setX - where X is the value they are setting.
instance data
accessor method
mutator method
character string
42. The classes of the Java standard class library are grouped into __________.
initialize
variable
packages
int compareTo (String str)
43. 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
encapsulation of an object
pointer
packages
local data
44. Returns all input remaining on the current line as a character string.
String nextLine( )
long
reserved word void
prefix form
45. Constructor: creates a new pseudorandom number generator.
String object
instance data
Random ( )
RH
46. 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
boolean value
java.lang package
conditionals
byte to short
47. Before you use a variable __________it
initialize
null
data values
reserved word void
48. Variables that don't contain any data
uninitialized variables
static int parseInt (String str)
java.lang package
Scanner class
49. They clarify the role a certain number has in the program.
higher
literal
packages
constants
50. Two floating data types: float - _______
tokens
double
boolean value
java.lang package