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. Returns all input remaining on the current line as a character string.
byte to short
reference
String format (double number)
String nextLine( )
2. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
constructors
signed
java.lang package
instance variable
3. Expressed in a Java program with single quotes
support methods
encapsulation
escape sequences
character literal
4. An explicit data value used in a program
literal
Scanner scan=new Scanner (System.in);
formal parameters
primitive variables
5. 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
promotion
variable declaration
String format (double number)
return statement
6. Before you use a variable __________it
static
prefix form
polymorphism
initialize
7. 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
class level
tokens
assignment statement
method invocation
8. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
Random class
parentheses
String toLowerCase ( )
String object
9. ____________ is instantiated in the traditional way using the new operator.
packages
public
the DecimalFormat class
private
10. 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
static
encapsulation of an object
primitive variables
11. An object has behaviors - which are defined by the ________ associated with that object.
operations
arithmetic
boolean value
inheritance
12. 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:
num=Integer.parseInt(str);
method declaration
dot operator
declared
13. When a variable is declared inside a method
packages
aliases
underscores
local data
14. Two floating data types: float - _______
double
Scanner scan=new Scanner (System.in);
String findInLine (String pattern)
String object
15. Begins with a backslash character ""
flow of control
literal
variable
escape sequences
16. Elements of input
variable name
variable
tokens
assignment conversion
17. They clarify the role a certain number has in the program.
have void
RH
constants
arithmetic
18. Returns the int corresponding to the value stored in the specified string
wrapper class
reserved word void
static int parseInt (String str)
declared
19. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
uninitialized variables
String format (double number)
parentheses
scope
20. 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
byte to short
string name;
variable declaration
a constructor
21. 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.
instance variable
have void
assignment conversion
the "import" declaration
22. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
method declaration
expression
behaviors of an object
long
23. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
header of a method
static
floating point numbers
Understanding
24. 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
higher
assignment
support methods
string name;
25. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
assignment
variable name
accessor method
have void
26. Modifier>type/void>identifier>parameters>method body
initialize
method declaration
instance data
constructors
27. 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
String next( )
method declaration
System.out.println
String object
28. _____ expression evaluated first
String concat (String str)
the "import" declaration
RH
parameter
29. 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.
inheritance
parameter list
string literal
reserved word void
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.
state of an object
enumerated type
byte to short
signed
31. The order in which statements are executed in a running program
parameter
String toUpperCase ( )
flow of control
private
32. Instance data should be defined with what________ visibility
private
long
arithmetic
Random class
33. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
support methods
String findInLine (String pattern)
System.out.println
String substring (int offset - int endIndex)
34. Returns the next input token as the indicated type.
boolean nextBoolean( )
instance data
constants
java.lang package
35. 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
class level
encapsulation of an object
char charAt (int index)
conditionals
36. Every object has two things: a state and a _____ of behaviors
boolean equals (String str)
set
packages
wrapper class
37. 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
RH
data values
import java.util*
wrapper class
38. Widening byte: _________ - to int - to long - to float - to double
byte to short
java.lang package
public
long
39. Four integer data types: byte - short - int - _____
double
long
floating point numbers
variable name
40. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
String toUpperCase ( )
visibility modifiers
data values
int length( )
41. Boolean type conversions are ___________
self-governing
not possible
Scanner useDelimiter(String pattern)
conditional statement
42. Returns a new string consisting of this string concatenated with str.
Scanner scan=new Scanner (System.in);
visibility modifiers
boolean equals (String str)
Scanner class
43. A value that is passed into a method when it is invoked
assignment
service methods
the "import" declaration
parameter
44. 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
pointer
string literal
aliases
Scanner class
45. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
promotion
String replace (char oldChar - char newChar)
java.lang package
called method
46. 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 list
conditionals
method
initialize
47. A ________________ is immutable.
RH
String object
Understanding
encapsulation
48. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
state of an object
have void
string literal
polymorphism
49. An object in Java - defined by the class String
character string
higher
a constructor
data values
50. Attempts to find the next occurence of the specified pattern - ignoring delimiters
encapsulation
String findInLine (String pattern)
boolean value
String toUpperCase ( )