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. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
constants
tokens
NumberFormat class
primitive variables
2. Constructor: creates a new string object with the same characters as str.
String (String str)
the DecimalFormat class
null
return statement
3. 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
Scanner class
variable declaration
autoboxing
literal
4. The order in which statements are executed in a running program
NumberFormat class
String replace (char oldChar - char newChar)
uninitialized variables
flow of control
5. Occurs when a value of one type is assigned to a variable of another type during which the value is converted to the new type.
String toLowerCase ( )
declared
RH
assignment conversion
6. 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.
Scanner scan=new Scanner (System.in);
reserved word void
RH
String nextLine( )
7. A variable that refers to an object must be __________
actual parameters
Random ( )
declared
String findInLine (String pattern)
8. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
accessor method
aliases
underscores
conditional statement
9. Returns a new string consisting of this string concatenated with str.
variable
String concat (String str)
constructors
constants
10. Methods in the Math class are ______
class
static
parameter
Random ( )
11. Constructors do not even _______; therefore they cannot return a value.
null
have void
Scanner scan=new Scanner (System.in);
the DecimalFormat class
12. Returns a new string consisting of this string concatenated with str.
uninitialized variables
polymorphism
boolean equals (String str)
inheritance
13. 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
conditional statement
variable declaration
wrapper class
method declaration
14. A class usually provides services to access and modify __________
assignment statement
operations
data values
variable name
15. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
method declaration
aliases
Random ( )
16. Boolean type conversions are ___________
called method
not possible
String toLowerCase ( )
byte nextByte( )
17. 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
variable
instance data
expression
static int parseInt (String str)
18. 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.
wrapper class
scope
boolean nextBoolean( )
inheritance
19. Every object has two things: a state and a _____ of behaviors
System.out.println
set
double
enumerated type
20. 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
public
boolean value
not possible
behaviors of an object
21. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
instantiation
encapsulation of an object
state of an object
assignment statement
22. Instance data should be defined with what________ visibility
parameter list
literal
higher
private
23. The automatic conversion between a primitive value and a corresponding wrapper object.
class
autoboxing
self-governing
service methods
24. The values passed into a method in an invocation; these are called the arguments to the method
flow of control
actual parameters
double
constructors
25. 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
header of a method
byte to short
method invocation
encapsulation of an object
26. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
static int parseInt (String str)
java.lang package
String substring (int offset - int endIndex)
return statement
27. 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
public
casting
floating point numbers
the "import" declaration
28. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
operations
not possible
instantiation
String toLowerCase ( )
29. _____ expression evaluated first
RH
parameter
boolean value
private
30. ______________ operators have higher precedence
encapsulation of an object
arithmetic
char charAt (int index)
parameter
31. A null reference indicates that a variable does not refer to an object
set
null
have void
long
32. Two categories of statements that control the flow of executing through a method: __________ and loops
conditionals
signed
service methods
instance variable
33. Four integer data types: byte - short - int - _____
java.lang package
flow of control
expression
long
34. A method that returns a value must have a _________
a constructor
return statement
tokens
String (String str)
35. Before you use a variable __________it
method
uninitialized variables
parameter list
initialize
36. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
actual parameters
static int parseInt (String str)
public
String replace (char oldChar - char newChar)
37. 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
scope
return statement
import java.util*
System.out.println
38. ++count; -- count
assignment statement
set
prefix form
literal
39. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
dot operator
assignment conversion
arithmetic
boolean equalsIgnoreCase (String str)
40. 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
parentheses
static int parseInt (String str)
instance data
Scanner class
41. Returns all input remaining on the current line as a character string.
int length( )
reference
operations
String nextLine( )
42. Modifier>type/void>identifier>parameters>method body
public
behaviors of an object
a constructor
method declaration
43. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
byte to short
variable
parentheses
String format (double number)
44. Each piece of data that we send to a method
boolean nextBoolean( )
class level
prefix form
parameter
45. The act of creating an object using the "new" operator
instantiation
packages
floating point numbers
data values
46. 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.
have void
int length( )
byte to short
visibility modifiers
47. 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
num=Integer.parseInt(str);
Scanner scan=new Scanner (System.in);
data values
string name;
48. The Scanner class is part of ___________________
autoboxing
instance variable
arithmetic
java.util class libary
49. A set of classes that supports the development of programs
attributes of an object
class library
char charAt (int index)
the DecimalFormat class
50. Returns the int corresponding to the value stored in the specified string
String format (double number)
parameter
static int parseInt (String str)
String object