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. 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.
Scanner class
reference
String (String str)
parameter list
2. Also called a selection statement b/c it allows us to choose which statement will be executed next.
char charAt (int index)
conditional statement
boolean equalsIgnoreCase (String str)
declared
3. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
RH
String object
String findInLine (String pattern)
4. A ________________ is immutable.
instance variable
String object
scope
double
5. 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:
String object
num=Integer.parseInt(str);
return statement
tokens
6. A set of classes that supports the development of programs
class library
String format (double number)
autoboxing
encapsulation of an object
7. 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 substring (int offset - int endIndex)
reserved word void
autoboxing
System.out.println
8. The Scanner class is part of ___________________
reference
support methods
java.util class libary
autoboxing
9. Part of the java.util class; picks a number at random out of a range of values.
encapsulation of an object
num=Integer.parseInt(str);
Random class
conditional statement
10. The automatic conversion between a primitive value and a corresponding wrapper object.
not possible
instance variable
autoboxing
static int parseInt (String str)
11. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
tokens
primitive variables
java.lang package
12. Cast operator has _________ precedence to division
higher
import java.util*
conditionals
not possible
13. 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
not possible
Understanding
reference
casting
14. 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
string literal
variable declaration
uninitialized variables
return statement
15. A class usually provides services to access and modify __________
escape sequences
tokens
data values
constants
16. Widening byte: _________ - to int - to long - to float - to double
byte to short
Random ( )
conditional statement
encapsulation
17. The declarations of object variables have a similar structure to the declaration of _______________
String format (double number)
mutator method
primitive variables
variable
18. sides=10;
scope
enumerated type
int length( )
assignment statement
19. Returns true if the scanner has anotehr token in its input.
variable name
boolean hasNext( )
boolean nextBoolean( )
aliases
20. Instance data should be defined with what________ visibility
boolean hasNext( )
boolean equalsIgnoreCase (String str)
private
String format (double number)
21. The names of the parameters in the header of the method declaration
higher
instance variable
method invocation
formal parameters
22. 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.
String nextLine( )
reserved word void
dot operator
instantiation
23. Methods in the Math class are ______
byte nextByte( )
constants
static
parameter
24. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
aliases
constructors
assignment statement
reserved word void
25. Returns the number of characters in this stirng.
return statement
state of an object
boolean value
int length( )
26. 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
double
String object
Scanner class
autoboxing
27. Constructor: creates a new pseudorandom number generator.
method declaration
NumberFormat class
declared
Random ( )
28. All numeric types are _______ - meaning both positive and negative values can be stored in them
import java.util*
String nextLine( )
signed
class library
29. An object in Java - defined by the class String
null
character string
primitive variables
behaviors of an object
30. We use an object when we have a _________ to it
assignment
casting
prefix form
reference
31. Sets the scanner's delimiting pattern.
header of a method
Scanner useDelimiter(String pattern)
the "import" declaration
java.lang package
32. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
dot operator
instance variable
initialize
flow of control
33. 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
inheritance
boolean value
System.out.println
escape sequences
34. Returns all input remaining on the current line as a character string.
casting
class level
String nextLine( )
String concat (String str)
35. ____________ is instantiated in the traditional way using the new operator.
byte to short
the DecimalFormat class
String object
pointer
36. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
constructors
boolean equalsIgnoreCase (String str)
char charAt (int index)
String substring (int offset - int endIndex)
37. White space characters such as space characters - tabs - and new lines that separate the elements of input
reference
delimiters
formal parameters
visibility modifiers
38. Modifier>type/void>identifier>parameters>method body
method declaration
local data
aliases
boolean nextBoolean( )
39. Each piece of data that we send to a method
operations
parameter
arithmetic
RH
40. Expressed in a Java program with single quotes
scope
casting
signed
character literal
41. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
Scanner class
accessor method
pointer
long
42. 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.
encapsulation
String concat (String str)
enumerated type
visibility modifiers
43. Constants are ______ because the can't be changed once you use the final modifier
public
conditional statement
behaviors of an object
class
44. 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.
autoboxing
enumerated type
String replace (char oldChar - char newChar)
self-governing
45. 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
parameter
casting
class
a constructor
46. Constructor: creates a new string object with the same characters as str.
underscores
primitive variables
String (String str)
mutator method
47. 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
String toLowerCase ( )
null
public
aliases
48. 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
String concat (String str)
parameter list
int compareTo (String str)
expression
49. 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
String toLowerCase ( )
static int parseInt (String str)
behaviors of an object
50. Returns the int corresponding to the value stored in the specified string
underscores
conditionals
static int parseInt (String str)
num=Integer.parseInt(str);