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. All numeric types are _______ - meaning both positive and negative values can be stored in them
attributes of an object
autoboxing
instance data
signed
2. Part of the java.util class; picks a number at random out of a range of values.
Random class
int compareTo (String str)
expression
static
3. Expressed in a Java program with single quotes
character literal
return statement
int compareTo (String str)
scope
4. Instance data should be defined with what________ visibility
string name;
variable
arithmetic
private
5. 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
conditional statement
String format (double number)
wrapper class
Understanding
6. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
class
long
state of an object
assignment conversion
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
character string
double
instantiation
aliases
8. 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.
Scanner useDelimiter(String pattern)
support methods
assignment conversion
accessor method
9. Modifier>type/void>identifier>parameters>method body
String next( )
boolean equals (String str)
flow of control
method declaration
10. Three ways in which Java conversions occur: _________ conversion - promotion - casting
String concat (String str)
assignment
service methods
String (String str)
11. Boolean type conversions are ___________
String substring (int offset - int endIndex)
promotion
not possible
null
12. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
String toUpperCase ( )
method invocation
promotion
String toLowerCase ( )
13. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
java.lang package
wrapper class
encapsulation
a constructor
14. Returns the int corresponding to the value stored in the specified string
floating point numbers
expression
static int parseInt (String str)
reference
15. A null reference indicates that a variable does not refer to an object
null
inheritance
not possible
String format (double number)
16. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
String substring (int offset - int endIndex)
constructors
wrapper class
instance variable
17. An object in Java - defined by the class String
character string
constructors
postfix form
String toLowerCase ( )
18. Returns a string containing the specified number formatted according to this object's pattern.
variable declaration
string name;
polymorphism
String format (double number)
19. The classes of the Java standard class library are grouped into __________.
int length( )
packages
string literal
formal parameters
20. They clarify the role a certain number has in the program.
self-governing
constants
String object
assignment statement
21. 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
RH
reference
boolean nextBoolean( )
pointer
22. A variable that refers to an object must be __________
escape sequences
class
declared
String object
23. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
floating point numbers
pointer
expression
delimiters
24. ____________ is instantiated in the traditional way using the new operator.
support methods
inheritance
the DecimalFormat class
expression
25. Returns the next input token as the indicated type.
parameter
string name;
import java.util*
byte nextByte( )
26. Two floating data types: float - _______
instantiation
conditional statement
signed
double
27. Cast operator has _________ precedence to division
instance variable
wrapper class
Random class
higher
28. 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 -
not possible
class
System.out.println
parentheses
29. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
the DecimalFormat class
String substring (int offset - int endIndex)
accessor method
delimiters
30. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
double
instance data
constructors
class level
31. 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
conditionals
not possible
class
32. 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
assignment statement
promotion
Scanner class
polymorphism
33. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
class
support methods
polymorphism
int compareTo (String str)
34. The order in which statements are executed in a running program
assignment statement
String format (double number)
flow of control
boolean value
35. Returns the character at the specified index.
instance data
method
char charAt (int index)
reserved word void
36. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
set
service methods
initialize
Random ( )
37. The one that is invoked
called method
static
parameter
String (String str)
38. 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
pointer
accessor method
casting
variable name
39. Each piece of data that we send to a method
casting
System.out.println
reference
parameter
40. New memory space is reserved for that variable every time an instance of the class that is created.
java.lang package
initialize
instance data
class
41. declaration that creates a String variable that holds a reference to a String object; an object variable doesn't hold an object itself - it holds the address of an object
static int parseInt (String str)
floating point numbers
string name;
enumerated type
42. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
String replace (char oldChar - char newChar)
packages
Random ( )
not possible
43. Represents either a primitive value or an object
string name;
formal parameters
variable name
parameter
44. 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
int compareTo (String str)
local data
boolean equalsIgnoreCase (String str)
45. Four integer data types: byte - short - int - _____
called method
long
visibility modifiers
boolean equalsIgnoreCase (String str)
46. 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
Random ( )
String (String str)
method invocation
Understanding
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
mutator method
Random ( )
variable declaration
parameter
48. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
support methods
escape sequences
method invocation
49. Variables and constants can be referenced in any method of the class by declaring at the _________
string literal
data values
behaviors of an object
class level
50. Returns true if the scanner has anotehr token in its input.
mutator method
boolean hasNext( )
wrapper class
delimiters