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. Variables and constants can be referenced in any method of the class by declaring at the _________
method
java.lang package
java.lang package
class level
2. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
parameter
class
support methods
variable declaration
3. _____ expression evaluated first
initialize
self-governing
java.util class libary
RH
4. Four integer data types: byte - short - int - _____
conditionals
long
encapsulation
class library
5. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
primitive variables
data values
expression
parentheses
6. Elements of input
variable declaration
formal parameters
tokens
packages
7. Returns the number of characters in this stirng.
String replace (char oldChar - char newChar)
boolean equalsIgnoreCase (String str)
attributes of an object
int length( )
8. The declarations of object variables have a similar structure to the declaration of _______________
String toUpperCase ( )
primitive variables
java.util class libary
a constructor
9. White space characters such as space characters - tabs - and new lines that separate the elements of input
string name;
boolean equals (String str)
delimiters
String format (double number)
10. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
casting
character literal
java.lang package
Random class
11. 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
have void
string name;
char charAt (int index)
conditionals
12. A variable that refers to an object must be __________
actual parameters
attributes of an object
declared
class level
13. Returns a new string consisting of this string concatenated with str.
parentheses
conditionals
pointer
boolean equals (String str)
14. 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 -
class
NumberFormat class
assignment statement
state of an object
15. Begins with a backslash character ""
promotion
constructors
escape sequences
byte to short
16. Changes a particular value - e.g.setX - where X is the value they are setting.
primitive variables
header of a method
null
mutator method
17. Represents either a primitive value or an object
string name;
variable name
return statement
int compareTo (String str)
18. Attempts to find the next occurence of the specified pattern - ignoring delimiters
packages
visibility modifiers
String findInLine (String pattern)
declared
19. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
self-governing
long
constructors
String substring (int offset - int endIndex)
20. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
polymorphism
initialize
NumberFormat class
Scanner class
21. Variables that don't contain any data
uninitialized variables
underscores
tokens
num=Integer.parseInt(str);
22. 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
Understanding
num=Integer.parseInt(str);
char charAt (int index)
Scanner class
23. A ________________ is immutable.
operations
String object
long
uninitialized variables
24. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
boolean value
polymorphism
String substring (int offset - int endIndex)
uninitialized variables
25. 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
string literal
declared
num=Integer.parseInt(str);
casting
26. Every object has two things: a state and a _____ of behaviors
set
public
escape sequences
floating point numbers
27. Returns the next input token as the indicated type.
reserved word void
boolean nextBoolean( )
byte nextByte( )
java.util class libary
28. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
wrapper class
String toLowerCase ( )
set
String toUpperCase ( )
29. A name for a location in memory used to hold a data value.
variable
boolean hasNext( )
variable name
literal
30. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
local data
flow of control
import java.util*
accessor method
31. Constructor: creates a new pseudorandom number generator.
data values
String next( )
class library
Random ( )
32. Returns a string containing the specified number formatted according to this object's pattern.
String (String str)
the "import" declaration
String format (double number)
signed
33. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
boolean value
the DecimalFormat class
floating point numbers
char charAt (int index)
34. Expressed in a Java program with single quotes
method
escape sequences
character literal
attributes of an object
35. The order in which statements are executed in a running program
attributes of an object
flow of control
the DecimalFormat class
parameter list
36. 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.
boolean nextBoolean( )
tokens
polymorphism
String replace (char oldChar - char newChar)
37. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
String replace (char oldChar - char newChar)
String object
private
enumerated type
38. ______________ operators have higher precedence
variable
string name;
character string
arithmetic
39. 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.
pointer
behaviors of an object
reserved word void
Scanner scan=new Scanner (System.in);
40. Boolean type conversions are ___________
java.lang package
not possible
declared
the "import" declaration
41. 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
promotion
encapsulation
inheritance
scope
42. Widening byte: _________ - to int - to long - to float - to double
aliases
static
byte to short
arithmetic
43. Also called a selection statement b/c it allows us to choose which statement will be executed next.
static
char charAt (int index)
conditional statement
method
44. 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
variable declaration
pointer
String findInLine (String pattern)
not possible
45. When a variable is declared inside a method
constructors
casting
postfix form
local data
46. Constructors do not even _______; therefore they cannot return a value.
conditionals
primitive variables
have void
boolean equals (String str)
47. The act of creating an object using the "new" operator
instantiation
parameter list
variable declaration
Scanner useDelimiter(String pattern)
48. A null reference indicates that a variable does not refer to an object
class level
null
instance data
dot operator
49. The classes of the Java standard class library are grouped into __________.
the DecimalFormat class
packages
character string
service methods
50. 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
String nextLine( )
enumerated type
class level