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. Instance data should be defined with what________ visibility
parameter
string literal
private
floating point numbers
2. 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
string name;
encapsulation of an object
byte to short
boolean nextBoolean( )
3. Constants are ______ because the can't be changed once you use the final modifier
public
boolean hasNext( )
floating point numbers
self-governing
4. Constructor: creates a new pseudorandom number generator.
String substring (int offset - int endIndex)
tokens
Random ( )
formal parameters
5. The one that is invoked
visibility modifiers
instantiation
called method
class
6. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
not possible
instance data
assignment statement
7. Attempts to find the next occurence of the specified pattern - ignoring delimiters
arithmetic
RH
string name;
String findInLine (String pattern)
8. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
return statement
constructors
static int parseInt (String str)
String findInLine (String pattern)
9. 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
pointer
byte nextByte( )
java.lang package
Understanding
10. Returns true if the scanner has anotehr token in its input.
public
boolean hasNext( )
pointer
char charAt (int index)
11. ____________ is instantiated in the traditional way using the new operator.
constants
string name;
formal parameters
the DecimalFormat class
12. This declaration creates a Scanner object that reads input from the keyboard
Scanner scan=new Scanner (System.in);
initialize
formal parameters
return statement
13. Returns the number of characters in this stirng.
instance data
int length( )
String object
variable name
14. 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.
String (String str)
constants
enumerated type
public
15. 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
prefix form
attributes of an object
instantiation
casting
16. An explicit data value used in a program
Scanner scan=new Scanner (System.in);
encapsulation
uninitialized variables
literal
17. Returns the int corresponding to the value stored in the specified string
static int parseInt (String str)
signed
java.lang package
class level
18. format for constants: all upper-case; separated by ________
String next( )
boolean hasNext( )
instance data
underscores
19. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
support methods
method declaration
class
promotion
20. A set of classes that supports the development of programs
class library
floating point numbers
java.lang package
assignment conversion
21. 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.
return statement
String nextLine( )
encapsulation
boolean equalsIgnoreCase (String str)
22. An object has behaviors - which are defined by the ________ associated with that object.
signed
boolean nextBoolean( )
operations
autoboxing
23. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
private
java.util class libary
promotion
return statement
24. Methods in the Math class are ______
escape sequences
a constructor
static
method declaration
25. The names of the parameters in the header of the method declaration
class level
not possible
underscores
formal parameters
26. Returns the character at the specified index.
char charAt (int index)
Random class
dot operator
parameter
27. Variables that don't contain any data
packages
uninitialized variables
inheritance
initialize
28. Provide various methods related to the management of the associated primitive type. Used when we create an object that serves as a container to hold various types of other objects - and we want the object to hold a simple integer value. In this case
variable declaration
accessor method
wrapper class
String findInLine (String pattern)
29. Also called a selection statement b/c it allows us to choose which statement will be executed next.
expression
conditional statement
flow of control
String nextLine( )
30. sides=10;
method invocation
assignment
byte to short
assignment statement
31. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
int compareTo (String str)
boolean nextBoolean( )
Random ( )
null
32. Two floating data types: float - _______
boolean value
variable declaration
double
conditional statement
33. Constructor: creates a new string object with the same characters as str.
String (String str)
String format (double number)
String nextLine( )
operations
34. Specifies the packages and classes that will be used in a program so that the fully qualified name is not necessary with each reference.
casting
the "import" declaration
long
instance data
35. 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.
assignment conversion
visibility modifiers
NumberFormat class
declared
36. 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:
primitive variables
boolean equalsIgnoreCase (String str)
RH
num=Integer.parseInt(str);
37. Returns a new string consisting of this string concatenated with str.
encapsulation of an object
byte nextByte( )
assignment statement
boolean equals (String str)
38. ++count; -- count
Scanner class
reference
prefix form
encapsulation of an object
39. The classes of the Java standard class library are grouped into __________.
floating point numbers
class level
packages
polymorphism
40. Returns the next input token as the indicated type.
boolean nextBoolean( )
Scanner class
arithmetic
instantiation
41. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
assignment conversion
static
pointer
header of a method
42. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
data values
import java.util*
num=Integer.parseInt(str);
constructors
43. A value that is passed into a method when it is invoked
parameter
the "import" declaration
not possible
postfix form
44. The values passed into a method in an invocation; these are called the arguments to the method
character string
Scanner scan=new Scanner (System.in);
actual parameters
assignment statement
45. 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
null
method invocation
the DecimalFormat class
prefix form
46. We use an object when we have a _________ to it
reference
uninitialized variables
method
variable
47. Widening byte: _________ - to int - to long - to float - to double
arithmetic
byte to short
support methods
operations
48. Represents either a primitive value or an object
conditional statement
variable name
String next( )
operations
49. Returns a string containing the specified number formatted according to this object's pattern.
expression
not possible
floating point numbers
String format (double number)
50. Four integer data types: byte - short - int - _____
set
self-governing
prefix form
long