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. Before you use a variable __________it
initialize
arithmetic
support methods
escape sequences
2. Returns the number of characters in this stirng.
variable declaration
method declaration
return statement
int length( )
3. Returns the next input token as the indicated type.
higher
boolean nextBoolean( )
byte nextByte( )
java.lang package
4. 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.
primitive variables
System.out.println
scope
static
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:
double
packages
num=Integer.parseInt(str);
parameter
6. 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.
parameter list
encapsulation
String concat (String str)
class
7. Returns true if the scanner has anotehr token in its input.
initialize
Random ( )
class library
boolean hasNext( )
8. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
called method
variable name
Scanner useDelimiter(String pattern)
java.lang package
9. Represents either a primitive value or an object
tokens
boolean value
char charAt (int index)
variable name
10. 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
System.out.println
class
boolean equals (String str)
Random ( )
11. Returns a new string consisting of this string concatenated with str.
String concat (String str)
primitive variables
actual parameters
Random ( )
12. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
instance data
static
aliases
13. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
self-governing
instantiation
encapsulation
boolean nextBoolean( )
14. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
assignment
String toLowerCase ( )
floating point numbers
local data
15. The act of creating an object using the "new" operator
String replace (char oldChar - char newChar)
String next( )
instantiation
set
16. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
java.lang package
variable name
String toUpperCase ( )
promotion
17. 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
null
have void
aliases
string name;
18. All wrapper classes are defined in ___________
local data
pointer
java.lang package
wrapper class
19. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
import java.util*
character string
NumberFormat class
wrapper class
20. The order in which statements are executed in a running program
data values
delimiters
flow of control
null
21. 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
int compareTo (String str)
assignment statement
method
string name;
22. Returns a new string consisting of this string concatenated with str.
static int parseInt (String str)
char charAt (int index)
boolean equals (String str)
underscores
23. A set of classes that supports the development of programs
arithmetic
String replace (char oldChar - char newChar)
class library
self-governing
24. An object in Java - defined by the class String
String findInLine (String pattern)
int compareTo (String str)
character string
class
25. Returns the next input token as the indicated type.
Random ( )
actual parameters
higher
byte nextByte( )
26. sides=10;
byte nextByte( )
scope
expression
assignment statement
27. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
initialize
NumberFormat class
Random ( )
28. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
String (String str)
constructors
constants
a constructor
29. ++count; -- count
prefix form
System.out.println
string name;
self-governing
30. A null reference indicates that a variable does not refer to an object
parameter list
null
String (String str)
the DecimalFormat class
31. Two floating data types: float - _______
class
double
instance data
Scanner useDelimiter(String pattern)
32. Boolean type conversions are ___________
the "import" declaration
operations
parentheses
not possible
33. 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
scope
String toUpperCase ( )
method invocation
signed
34. Declared in a class but not inside any particular method
static int parseInt (String str)
num=Integer.parseInt(str);
instance data
boolean equals (String str)
35. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
null
support methods
tokens
36. ____________ is instantiated in the traditional way using the new operator.
declared
parameter
Understanding
the DecimalFormat class
37. 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
string name;
boolean equalsIgnoreCase (String str)
primitive variables
instantiation
38. 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
Scanner class
method declaration
tokens
attributes of an object
39. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
String object
behaviors of an object
variable declaration
int compareTo (String str)
40. 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.
packages
conditionals
parameter list
promotion
41. The declarations of object variables have a similar structure to the declaration of _______________
primitive variables
parameter
method
reference
42. A ________________ is immutable.
String object
Random ( )
promotion
called method
43. Modifier>type/void>identifier>parameters>method body
encapsulation of an object
method declaration
arithmetic
boolean nextBoolean( )
44. Expressed in a Java program with single quotes
variable declaration
character literal
polymorphism
constructors
45. White space characters such as space characters - tabs - and new lines that separate the elements of input
boolean value
delimiters
java.lang package
constants
46. When a variable is declared inside a method
local data
expression
parameter
mutator method
47. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
instantiation
import java.util*
postfix form
RH
48. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
accessor method
char charAt (int index)
prefix form
NumberFormat class
49. ______________ operators have higher precedence
reserved word void
arithmetic
instance data
conditionals
50. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
variable
String substring (int offset - int endIndex)
polymorphism
parameter list