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. Widening byte: _________ - to int - to long - to float - to double
primitive variables
int length( )
byte to short
prefix form
2. Changes a particular value - e.g.setX - where X is the value they are setting.
called method
mutator method
boolean value
uninitialized variables
3. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
String toUpperCase ( )
class level
parentheses
dot operator
4. Constants are ______ because the can't be changed once you use the final modifier
uninitialized variables
boolean hasNext( )
instance variable
public
5. The one that is invoked
called method
promotion
int length( )
dot operator
6. 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:
escape sequences
public
byte nextByte( )
num=Integer.parseInt(str);
7. 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.
char charAt (int index)
accessor method
scope
method declaration
8. ______________ operators have higher precedence
not possible
Scanner useDelimiter(String pattern)
variable
arithmetic
9. Elements of input
parameter
String next( )
tokens
byte to short
10. 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.
java.lang package
boolean equals (String str)
reserved word void
java.lang package
11. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
have void
static int parseInt (String str)
operations
self-governing
12. A variable that refers to an object must be __________
declared
System.out.println
Scanner class
pointer
13. Returns the character at the specified index.
static int parseInt (String str)
String substring (int offset - int endIndex)
char charAt (int index)
System.out.println
14. A ________________ is immutable.
promotion
String object
variable name
wrapper class
15. An object in Java - defined by the class String
import java.util*
enumerated type
character string
support methods
16. Instance data should be defined with what________ visibility
support methods
boolean nextBoolean( )
private
String findInLine (String pattern)
17. 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.
character literal
long
boolean hasNext( )
polymorphism
18. Returns true if the scanner has anotehr token in its input.
boolean hasNext( )
java.lang package
initialize
service methods
19. 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
constants
conditional statement
byte to short
inheritance
20. 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
conditionals
Scanner class
Understanding
instance data
21. Two categories of statements that control the flow of executing through a method: __________ and loops
conditional statement
uninitialized variables
boolean nextBoolean( )
conditionals
22. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
not possible
actual parameters
import java.util*
23. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
Scanner scan=new Scanner (System.in);
service methods
assignment conversion
conditionals
24. Delimited by double quotation characters
mutator method
encapsulation
private
string literal
25. 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
assignment
constants
dot operator
26. 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
method declaration
encapsulation of an object
import java.util*
String findInLine (String pattern)
27. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
promotion
self-governing
instance data
dot operator
28. 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
variable declaration
String findInLine (String pattern)
class
dot operator
29. When a variable is declared inside a method
parameter list
local data
Understanding
visibility modifiers
30. 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.
set
scope
parameter list
self-governing
31. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
service methods
java.lang package
long
int length( )
32. The names of the parameters in the header of the method declaration
parameter
formal parameters
variable name
NumberFormat class
33. Part of the java.util class; picks a number at random out of a range of values.
String object
NumberFormat class
prefix form
Random class
34. 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 -
escape sequences
class
character literal
string name;
35. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
encapsulation
promotion
support methods
packages
36. The Scanner class is part of ___________________
public
dot operator
java.util class libary
Random ( )
37. _____ expression evaluated first
behaviors of an object
declared
assignment statement
RH
38. 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.
packages
String next( )
mutator method
encapsulation
39. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
higher
import java.util*
String nextLine( )
method invocation
40. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
String concat (String str)
Scanner class
String substring (int offset - int endIndex)
the "import" declaration
41. Before you use a variable __________it
public
String toUpperCase ( )
initialize
operations
42. The classes of the Java standard class library are grouped into __________.
null
header of a method
character literal
packages
43. 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
pointer
num=Integer.parseInt(str);
state of an object
polymorphism
44. A null reference indicates that a variable does not refer to an object
long
boolean hasNext( )
null
flow of control
45. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
encapsulation of an object
variable
string literal
46. All wrapper classes are defined in ___________
java.lang package
import java.util*
formal parameters
called method
47. 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.
Scanner class
visibility modifiers
Understanding
public
48. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
parameter list
constructors
autoboxing
delimiters
49. A name for a location in memory used to hold a data value.
variable
String toUpperCase ( )
inheritance
char charAt (int index)
50. 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
encapsulation of an object
reserved word void
method
support methods