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. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
java.lang package
dot operator
string name;
floating point numbers
2. An object has behaviors - which are defined by the ________ associated with that object.
scope
parameter list
operations
autoboxing
3. New memory space is reserved for that variable every time an instance of the class that is created.
instance data
String findInLine (String pattern)
String concat (String str)
String object
4. Boolean type conversions are ___________
not possible
instance variable
literal
boolean value
5. Constructor: creates a new pseudorandom number generator.
Understanding
delimiters
Random ( )
String (String str)
6. Constructors do not even _______; therefore they cannot return a value.
String toUpperCase ( )
pointer
Scanner class
have void
7. Returns a string containing the specified number formatted according to this object's pattern.
int compareTo (String str)
int length( )
enumerated type
String format (double number)
8. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
tokens
dot operator
support methods
accessor method
9. Occurs when a value of one type is assigned to a variable of another type during which the value is converted to the new type.
assignment conversion
service methods
parameter list
String next( )
10. Before you use a variable __________it
return statement
initialize
class
NumberFormat class
11. sides=10;
double
Scanner scan=new Scanner (System.in);
assignment statement
System.out.println
12. 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.
class
NumberFormat class
scope
method invocation
13. A variable that refers to an object must be __________
String next( )
boolean equalsIgnoreCase (String str)
declared
enumerated type
14. 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
assignment
parentheses
aliases
encapsulation of an object
15. Instance data should be defined with what________ visibility
private
char charAt (int index)
Random class
service methods
16. 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.
polymorphism
constructors
String toLowerCase ( )
header of a method
17. They clarify the role a certain number has in the program.
initialize
constants
Random class
NumberFormat class
18. ______________ operators have higher precedence
System.out.println
visibility modifiers
arithmetic
signed
19. Cast operator has _________ precedence to division
promotion
autoboxing
higher
a constructor
20. Constructor: creates a new string object with the same characters as str.
self-governing
character string
instance data
String (String str)
21. 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.
actual parameters
parameter list
num=Integer.parseInt(str);
variable name
22. Expressed in a Java program with single quotes
reference
character literal
java.util class libary
String concat (String str)
23. Attempts to find the next occurence of the specified pattern - ignoring delimiters
String findInLine (String pattern)
assignment conversion
prefix form
floating point numbers
24. Widening byte: _________ - to int - to long - to float - to double
byte to short
String (String str)
floating point numbers
String replace (char oldChar - char newChar)
25. 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
service methods
variable name
inheritance
the "import" declaration
26. The one that is invoked
called method
String findInLine (String pattern)
static
delimiters
27. Variables that don't contain any data
Scanner class
RH
Random ( )
uninitialized variables
28. Variables and constants can be referenced in any method of the class by declaring at the _________
String next( )
string name;
class level
parameter
29. A value that is passed into a method when it is invoked
variable
packages
parameter
postfix form
30. format for constants: all upper-case; separated by ________
underscores
double
null
data values
31. Returns the character at the specified index.
char charAt (int index)
higher
behaviors of an object
boolean equals (String str)
32. Also called a selection statement b/c it allows us to choose which statement will be executed next.
local data
String next( )
prefix form
conditional statement
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
Understanding
a constructor
casting
character literal
34. ++count; -- count
instance data
prefix form
assignment
pointer
35. The values passed into a method in an invocation; these are called the arguments to the method
parameter list
actual parameters
variable
boolean value
36. The Scanner class is part of ___________________
visibility modifiers
called method
signed
java.util class libary
37. An explicit data value used in a program
boolean equals (String str)
Understanding
formal parameters
literal
38. Four integer data types: byte - short - int - _____
constants
long
conditional statement
constructors
39. ____________ is instantiated in the traditional way using the new operator.
parentheses
boolean hasNext( )
the DecimalFormat class
instantiation
40. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
boolean equals (String str)
packages
class
41. Modifier>type/void>identifier>parameters>method body
not possible
instance data
delimiters
method declaration
42. When a variable is declared inside a method
parameter
local data
int compareTo (String str)
String nextLine( )
43. Returns true if the scanner has anotehr token in its input.
return statement
declared
boolean hasNext( )
parameter
44. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
promotion
int compareTo (String str)
String toUpperCase ( )
return statement
45. The declarations of object variables have a similar structure to the declaration of _______________
primitive variables
Scanner useDelimiter(String pattern)
conditional statement
String findInLine (String pattern)
46. 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
dot operator
class level
encapsulation
attributes of an object
47. 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
pointer
tokens
aliases
variable declaration
48. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
Random ( )
Scanner class
assignment statement
self-governing
49. Two categories of statements that control the flow of executing through a method: __________ and loops
assignment
instance variable
char charAt (int index)
conditionals
50. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
the DecimalFormat class
parameter
postfix form
behaviors of an object