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 declarations of object variables have a similar structure to the declaration of _______________
behaviors of an object
reference
java.lang package
primitive variables
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
instantiation
tokens
called method
attributes of an object
3. Specifies the packages and classes that will be used in a program so that the fully qualified name is not necessary with each reference.
instantiation
the "import" declaration
int length( )
literal
4. ____________ is instantiated in the traditional way using the new operator.
string name;
the DecimalFormat class
prefix form
service methods
5. Widening byte: _________ - to int - to long - to float - to double
formal parameters
return statement
byte to short
prefix form
6. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
dot operator
floating point numbers
String findInLine (String pattern)
expression
7. All numeric types are _______ - meaning both positive and negative values can be stored in them
promotion
accessor method
autoboxing
signed
8. 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:
packages
String (String str)
encapsulation of an object
num=Integer.parseInt(str);
9. New memory space is reserved for that variable every time an instance of the class that is created.
called method
java.lang package
instance data
initialize
10. 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
actual parameters
expression
assignment
arithmetic
11. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
encapsulation of an object
import java.util*
Scanner scan=new Scanner (System.in);
floating point numbers
12. Every object has two things: a state and a _____ of behaviors
wrapper class
class library
set
private
13. A class usually provides services to access and modify __________
autoboxing
parentheses
Understanding
data values
14. sides=10;
variable name
long
byte nextByte( )
assignment statement
15. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
local data
uninitialized variables
Scanner scan=new Scanner (System.in);
instance variable
16. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
initialize
boolean hasNext( )
aliases
self-governing
17. 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
parentheses
have void
wrapper class
autoboxing
18. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
conditionals
String toUpperCase ( )
String findInLine (String pattern)
boolean equals (String str)
19. Returns the number of characters in this stirng.
int length( )
primitive variables
private
num=Integer.parseInt(str);
20. 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
Random class
postfix form
enumerated type
21. A value that is passed into a method when it is invoked
literal
assignment statement
parameter
static int parseInt (String str)
22. A variable that refers to an object must be __________
declared
set
class
mutator method
23. Two floating data types: float - _______
floating point numbers
double
enumerated type
static int parseInt (String str)
24. Before you use a variable __________it
java.lang package
pointer
initialize
signed
25. Expressed in a Java program with single quotes
reserved word void
character literal
signed
Scanner class
26. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
have void
inheritance
String object
accessor method
27. 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 -
called method
null
class
double
28. 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 scan=new Scanner (System.in);
mutator method
polymorphism
called method
29. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
static int parseInt (String str)
System.out.println
String nextLine( )
30. 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.
underscores
enumerated type
parentheses
method invocation
31. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
String substring (int offset - int endIndex)
actual parameters
boolean nextBoolean( )
state of an object
32. 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 declaration
double
assignment
method
33. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String (String str)
polymorphism
String toLowerCase ( )
method invocation
34. Four integer data types: byte - short - int - _____
wrapper class
instance variable
long
private
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
static
encapsulation
parameter list
36. Represents either a primitive value or an object
set
parameter list
variable name
higher
37. 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
flow of control
header of a method
encapsulation of an object
Scanner useDelimiter(String pattern)
38. We use an object when we have a _________ to it
reference
Understanding
Random ( )
method invocation
39. 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.
conditional statement
not possible
reserved word void
actual parameters
40. 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
boolean equals (String str)
enumerated type
mutator method
Scanner class
41. When a variable is declared inside a method
Scanner scan=new Scanner (System.in);
local data
service methods
java.util class libary
42. 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
long
instantiation
boolean value
initialize
43. 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
aliases
conditionals
behaviors of an object
Random ( )
44. Also called a selection statement b/c it allows us to choose which statement will be executed next.
boolean value
int compareTo (String str)
conditional statement
literal
45. 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.
visibility modifiers
variable
class level
encapsulation
46. Modifier>type/void>identifier>parameters>method body
signed
underscores
String findInLine (String pattern)
method declaration
47. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
NumberFormat class
header of a method
int compareTo (String str)
constructors
48. Declared in a class but not inside any particular method
mutator method
System.out.println
operations
instance data
49. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
a constructor
escape sequences
java.lang package
not possible
50. The one that is invoked
called method
postfix form
string name;
Understanding