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. 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
encapsulation
boolean equalsIgnoreCase (String str)
a constructor
local data
2. Returns all input remaining on the current line as a character string.
private
string name;
constants
String nextLine( )
3. Each piece of data that we send to a method
actual parameters
RH
parameter
accessor method
4. Constants are ______ because the can't be changed once you use the final modifier
conditionals
underscores
character string
public
5. Before you use a variable __________it
initialize
set
byte to short
method
6. Part of the java.util class; picks a number at random out of a range of values.
actual parameters
Random class
delimiters
conditional statement
7. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
called method
boolean equalsIgnoreCase (String str)
reserved word void
accessor method
8. 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
String findInLine (String pattern)
String nextLine( )
method invocation
9. Attempts to find the next occurence of the specified pattern - ignoring delimiters
String findInLine (String pattern)
java.lang package
variable name
attributes of an object
10. A name for a location in memory used to hold a data value.
header of a method
variable
not possible
class
11. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
NumberFormat class
character literal
Random ( )
self-governing
12. The names of the parameters in the header of the method declaration
scope
formal parameters
aliases
byte to short
13. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
String toUpperCase ( )
Scanner scan=new Scanner (System.in);
class library
primitive variables
14. Two categories of statements that control the flow of executing through a method: __________ and loops
tokens
actual parameters
System.out.println
conditionals
15. The one that is invoked
called method
variable name
static int parseInt (String str)
local data
16. The Scanner class is part of ___________________
Random ( )
header of a method
import java.util*
java.util class libary
17. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
Scanner class
operations
have void
support methods
18. The act of creating an object using the "new" operator
floating point numbers
instance variable
static
instantiation
19. 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
private
wrapper class
String findInLine (String pattern)
class library
20. Two floating data types: float - _______
Understanding
reference
double
String toLowerCase ( )
21. Modifier>type/void>identifier>parameters>method body
method declaration
constants
constructors
int compareTo (String str)
22. Declared in a class but not inside any particular method
instance data
encapsulation
prefix form
reference
23. They clarify the role a certain number has in the program.
char charAt (int index)
inheritance
constants
called method
24. When a variable is declared inside a method
a constructor
assignment statement
local data
reference
25. 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
byte nextByte( )
the DecimalFormat class
char charAt (int index)
Scanner class
26. An explicit data value used in a program
variable name
instance data
literal
int compareTo (String str)
27. A set of classes that supports the development of programs
service methods
reference
class library
a constructor
28. Begins with a backslash character ""
set
escape sequences
actual parameters
initialize
29. A class usually provides services to access and modify __________
scope
dot operator
Random class
data values
30. Cast operator has _________ precedence to division
behaviors of an object
constructors
higher
self-governing
31. format for constants: all upper-case; separated by ________
String toLowerCase ( )
underscores
assignment conversion
signed
32. A null reference indicates that a variable does not refer to an object
null
mutator method
conditionals
String substring (int offset - int endIndex)
33. Constructor: creates a new string object with the same characters as str.
reserved word void
String nextLine( )
constants
String (String str)
34. 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
Scanner useDelimiter(String pattern)
expression
assignment conversion
accessor method
35. Constructor: creates a new pseudorandom number generator.
String nextLine( )
instance data
Random ( )
boolean equals (String str)
36. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
service methods
local data
mutator method
constants
37. 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.
variable
visibility modifiers
long
called method
38. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
instance variable
constants
reference
num=Integer.parseInt(str);
39. This declaration creates a Scanner object that reads input from the keyboard
header of a method
data values
scope
Scanner scan=new Scanner (System.in);
40. 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.
operations
self-governing
scope
pointer
41. The order in which statements are executed in a running program
conditionals
accessor method
flow of control
the DecimalFormat class
42. Methods in the Math class are ______
boolean hasNext( )
double
static
String object
43. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
initialize
instance variable
visibility modifiers
44. Returns the next input token as a character string.
String next( )
encapsulation of an object
String (String str)
reference
45. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
NumberFormat class
variable name
scope
constants
46. 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.
header of a method
flow of control
reserved word void
postfix form
47. ++count; -- count
delimiters
underscores
Scanner useDelimiter(String pattern)
prefix form
48. Count++; count--
public
casting
postfix form
promotion
49. A method that returns a value must have a _________
return statement
RH
Understanding
scope
50. Also called a selection statement b/c it allows us to choose which statement will be executed next.
String findInLine (String pattern)
conditional statement
boolean equalsIgnoreCase (String str)
class level