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. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
parameter
byte nextByte( )
header of a method
static
2. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
floating point numbers
num=Integer.parseInt(str);
dot operator
flow of control
3. The one that is invoked
called method
prefix form
static int parseInt (String str)
Scanner class
4. White space characters such as space characters - tabs - and new lines that separate the elements of input
have void
header of a method
arithmetic
delimiters
5. Begins with a backslash character ""
escape sequences
Random ( )
Scanner useDelimiter(String pattern)
promotion
6. Returns all input remaining on the current line as a character string.
instance data
reference
service methods
String nextLine( )
7. 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
the "import" declaration
casting
not possible
byte to short
8. sides=10;
visibility modifiers
assignment statement
byte to short
a constructor
9. 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
boolean value
not possible
a constructor
string name;
10. Part of the java.util class; picks a number at random out of a range of values.
Random class
encapsulation
the DecimalFormat class
local data
11. Returns the next input token as the indicated type.
not possible
flow of control
literal
boolean nextBoolean( )
12. A ________________ is immutable.
a constructor
uninitialized variables
String object
assignment
13. A set of classes that supports the development of programs
NumberFormat class
class library
underscores
boolean value
14. The values passed into a method in an invocation; these are called the arguments to the method
java.lang package
attributes of an object
actual parameters
Scanner class
15. 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
actual parameters
operations
num=Integer.parseInt(str);
16. 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
instance data
a constructor
num=Integer.parseInt(str);
class
17. _____ expression evaluated first
RH
encapsulation of an object
expression
delimiters
18. 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
parameter
string name;
System.out.println
19. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
the "import" declaration
return statement
constructors
method declaration
20. An object in Java - defined by the class String
support methods
enumerated type
character string
pointer
21. 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
arithmetic
floating point numbers
aliases
Scanner class
22. New memory space is reserved for that variable every time an instance of the class that is created.
NumberFormat class
Scanner class
instance data
a constructor
23. Three ways in which Java conversions occur: _________ conversion - promotion - casting
postfix form
assignment
the DecimalFormat class
local data
24. Count++; count--
postfix form
operations
Understanding
encapsulation
25. Constructor: creates a new string object with the same characters as str.
double
service methods
null
String (String str)
26. 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.
polymorphism
parameter list
prefix form
dot operator
27. Returns the int corresponding to the value stored in the specified string
double
Random class
static int parseInt (String str)
encapsulation
28. Two categories of statements that control the flow of executing through a method: __________ and loops
declared
conditionals
character string
reserved word void
29. A class usually provides services to access and modify __________
data values
String replace (char oldChar - char newChar)
expression
String toUpperCase ( )
30. Behaviors associated with a bank account (which include the ability to make deposits and withdrawals)
primitive variables
boolean value
behaviors of an object
null
31. Expressed in a Java program with single quotes
character literal
a constructor
accessor method
set
32. 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.
set
method
reference
scope
33. 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
reserved word void
header of a method
char charAt (int index)
34. An explicit data value used in a program
parameter
reference
a constructor
literal
35. 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
attributes of an object
variable declaration
operations
boolean hasNext( )
36. This declaration creates a Scanner object that reads input from the keyboard
floating point numbers
String toLowerCase ( )
polymorphism
Scanner scan=new Scanner (System.in);
37. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
boolean hasNext( )
num=Integer.parseInt(str);
service methods
tokens
38. Returns a string containing the specified number formatted according to this object's pattern.
visibility modifiers
String format (double number)
not possible
int compareTo (String str)
39. Returns the next input token as the indicated type.
reference
byte nextByte( )
promotion
parameter
40. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
string literal
parentheses
escape sequences
header of a method
41. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
variable name
null
import java.util*
floating point numbers
42. ____________ is instantiated in the traditional way using the new operator.
static int parseInt (String str)
the DecimalFormat class
escape sequences
delimiters
43. Constructors do not even _______; therefore they cannot return a value.
Scanner class
have void
constructors
postfix form
44. Also called a selection statement b/c it allows us to choose which statement will be executed next.
polymorphism
conditional statement
declared
assignment statement
45. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
self-governing
instance variable
accessor method
floating point numbers
46. Returns true if the scanner has anotehr token in its input.
assignment
Scanner class
boolean hasNext( )
floating point numbers
47. After an object has been instantiated - we set the _________ to access its methods
floating point numbers
literal
dot operator
assignment conversion
48. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
self-governing
String substring (int offset - int endIndex)
conditional statement
49. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
support methods
instance data
signed
int compareTo (String str)
50. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
floating point numbers
int compareTo (String str)
not possible
String substring (int offset - int endIndex)