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. Sets the scanner's delimiting pattern.
instance data
uninitialized variables
Scanner useDelimiter(String pattern)
String substring (int offset - int endIndex)
2. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
class
NumberFormat class
mutator method
expression
3. ______________ operators have higher precedence
arithmetic
Scanner useDelimiter(String pattern)
pointer
character string
4. 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.
static int parseInt (String str)
reserved word void
postfix form
string name;
5. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
java.lang package
Understanding
support methods
Scanner useDelimiter(String pattern)
6. Widening byte: _________ - to int - to long - to float - to double
byte to short
import java.util*
actual parameters
String nextLine( )
7. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
header of a method
polymorphism
NumberFormat class
int compareTo (String str)
8. Constructors do not even _______; therefore they cannot return a value.
java.lang package
have void
set
state of an object
9. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
inheritance
java.lang package
Scanner scan=new Scanner (System.in);
10. We use an object when we have a _________ to it
arithmetic
reference
java.util class libary
String toLowerCase ( )
11. 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.
visibility modifiers
parameter
parentheses
packages
12. Returns the int corresponding to the value stored in the specified string
variable declaration
static int parseInt (String str)
instance data
support methods
13. 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
parameter list
method invocation
instance data
parameter
14. 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.
parentheses
java.lang package
scope
String toUpperCase ( )
15. 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
parameter
class library
header of a method
pointer
16. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
java.lang package
state of an object
flow of control
string literal
17. 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
dot operator
null
class level
variable declaration
18. Only two valid values: true and false; can indicate whether a particular condition is true - but can also be used to represent any situation that has two states - such as a light bulb being on or off
postfix form
boolean value
static int parseInt (String str)
visibility modifiers
19. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
String toLowerCase ( )
constructors
behaviors of an object
Scanner useDelimiter(String pattern)
20. The automatic conversion between a primitive value and a corresponding wrapper object.
autoboxing
String substring (int offset - int endIndex)
reference
char charAt (int index)
21. Returns all input remaining on the current line as a character string.
promotion
support methods
String nextLine( )
instantiation
22. Three ways in which Java conversions occur: _________ conversion - promotion - casting
NumberFormat class
assignment
instantiation
private
23. 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
uninitialized variables
operations
public
casting
24. Constructor: creates a new pseudorandom number generator.
static int parseInt (String str)
initialize
Random ( )
scope
25. After an object has been instantiated - we set the _________ to access its methods
method declaration
dot operator
java.lang package
parameter list
26. A null reference indicates that a variable does not refer to an object
instance data
java.lang package
null
instance variable
27. The one that is invoked
called method
tokens
String object
delimiters
28. New memory space is reserved for that variable every time an instance of the class that is created.
arithmetic
assignment
conditionals
instance data
29. Also called a selection statement b/c it allows us to choose which statement will be executed next.
wrapper class
conditional statement
String object
character literal
30. Constructor: creates a new string object with the same characters as str.
accessor method
String (String str)
double
static
31. ____________ is instantiated in the traditional way using the new operator.
formal parameters
variable
NumberFormat class
the DecimalFormat class
32. Instance data should be defined with what________ visibility
import java.util*
private
variable name
a constructor
33. Declared in a class but not inside any particular method
Scanner scan=new Scanner (System.in);
instance data
boolean value
null
34. _____ expression evaluated first
behaviors of an object
initialize
primitive variables
RH
35. 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
aliases
pointer
Random class
mutator method
36. Elements of input
tokens
assignment
delimiters
byte to short
37. The values it stores internally - which may be represented as primitive data or as other objects. for example - a bank account object can store a floating point number (a primitive value) that represents the balance of the account. it can also contai
character string
attributes of an object
state of an object
enumerated type
38. When a variable is declared inside a method
java.util class libary
boolean equals (String str)
local data
encapsulation
39. Begins with a backslash character ""
data values
escape sequences
not possible
variable
40. Returns the next input token as a character string.
String next( )
instance data
RH
parentheses
41. The classes of the Java standard class library are grouped into __________.
instantiation
underscores
Scanner useDelimiter(String pattern)
packages
42. Each piece of data that we send to a method
parameter
assignment
private
dot operator
43. A value that is passed into a method when it is invoked
parameter
higher
the "import" declaration
scope
44. Attempts to find the next occurence of the specified pattern - ignoring delimiters
conditionals
String findInLine (String pattern)
wrapper class
parameter
45. Methods in the Math class are ______
String concat (String str)
Scanner scan=new Scanner (System.in);
higher
static
46. The values passed into a method in an invocation; these are called the arguments to the method
static int parseInt (String str)
String next( )
actual parameters
underscores
47. Expressed in a Java program with single quotes
initialize
Random ( )
character literal
the "import" declaration
48. The order in which statements are executed in a running program
primitive variables
String replace (char oldChar - char newChar)
java.lang package
flow of control
49. 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
declared
byte nextByte( )
Random class
Scanner class
50. Specifies the packages and classes that will be used in a program so that the fully qualified name is not necessary with each reference.
the "import" declaration
initialize
byte to short
variable declaration