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. 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
attributes of an object
method invocation
string literal
String findInLine (String pattern)
2. Returns the character at the specified index.
self-governing
data values
char charAt (int index)
arithmetic
3. Variables and constants can be referenced in any method of the class by declaring at the _________
accessor method
encapsulation of an object
class level
java.util class libary
4. Elements of input
tokens
boolean equalsIgnoreCase (String str)
support methods
String replace (char oldChar - char newChar)
5. The automatic conversion between a primitive value and a corresponding wrapper object.
parameter
autoboxing
variable
formal parameters
6. 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
NumberFormat class
boolean hasNext( )
pointer
operations
7. A class usually provides services to access and modify __________
parameter list
assignment
data values
null
8. We use an object when we have a _________ to it
reference
Scanner scan=new Scanner (System.in);
dot operator
floating point numbers
9. 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:
arithmetic
num=Integer.parseInt(str);
RH
byte to short
10. Returns a new string identical to this string except all uppercase letters are converted to their lowercase equivalent.
String toLowerCase ( )
postfix form
long
System.out.println
11. All numeric types are _______ - meaning both positive and negative values can be stored in them
uninitialized variables
flow of control
signed
not possible
12. 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
service methods
visibility modifiers
method
boolean value
13. Variables that don't contain any data
instance data
wrapper class
double
uninitialized variables
14. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
System.out.println
method declaration
state of an object
variable declaration
15. 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
null
java.lang package
String (String str)
expression
16. Returns the number of characters in this stirng.
class level
conditional statement
accessor method
int length( )
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 scan=new Scanner (System.in);
support methods
state of an object
service methods
18. White space characters such as space characters - tabs - and new lines that separate the elements of input
operations
delimiters
signed
int compareTo (String str)
19. 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
encapsulation of an object
method
method invocation
service methods
20. The classes of the Java standard class library are grouped into __________.
packages
Scanner scan=new Scanner (System.in);
local data
have void
21. Widening byte: _________ - to int - to long - to float - to double
class level
RH
byte to short
not possible
22. format for constants: all upper-case; separated by ________
java.lang package
underscores
method declaration
static
23. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
instance variable
import java.util*
prefix form
class
24. Delimited by double quotation characters
instantiation
string literal
int compareTo (String str)
uninitialized variables
25. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
byte to short
string literal
data values
accessor method
26. ____________ is instantiated in the traditional way using the new operator.
boolean nextBoolean( )
the DecimalFormat class
Random ( )
Scanner scan=new Scanner (System.in);
27. sides=10;
underscores
method
String (String str)
assignment statement
28. An object has behaviors - which are defined by the ________ associated with that object.
null
operations
String replace (char oldChar - char newChar)
local data
29. Returns the next input token as the indicated type.
character literal
casting
boolean nextBoolean( )
reference
30. Constructor: creates a new string object with the same characters as str.
instance data
Scanner scan=new Scanner (System.in);
String (String str)
class
31. Two floating data types: float - _______
double
java.lang package
aliases
static int parseInt (String str)
32. Before you use a variable __________it
initialize
class
formal parameters
parameter list
33. 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 (String str)
aliases
String toUpperCase ( )
34. _____ expression evaluated first
underscores
self-governing
RH
Random class
35. Returns a new string consisting of this string concatenated with str.
string name;
character literal
String concat (String str)
long
36. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
expression
String replace (char oldChar - char newChar)
Random class
wrapper class
37. A variable that refers to an object must be __________
variable
declared
initialize
encapsulation of an object
38. Methods in the Math class are ______
java.lang package
NumberFormat class
literal
static
39. Returns the next input token as a character string.
service methods
instantiation
String next( )
have void
40. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
NumberFormat class
dot operator
assignment
byte to short
41. 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
boolean equals (String str)
Scanner class
class level
character literal
42. New memory space is reserved for that variable every time an instance of the class that is created.
accessor method
String nextLine( )
string name;
instance data
43. Constants are ______ because the can't be changed once you use the final modifier
tokens
expression
public
literal
44. Returns true if the scanner has anotehr token in its input.
boolean hasNext( )
num=Integer.parseInt(str);
String toLowerCase ( )
Random class
45. In the header of a method specifies he types of the values that are passed and the names by which the called method will refer to those values.
parameter list
uninitialized variables
java.lang package
NumberFormat class
46. Returns a new string identical to this string except all lowercase letters are converted to their uppercase equivalent.
polymorphism
String toUpperCase ( )
String next( )
String format (double number)
47. A value that is passed into a method when it is invoked
parameter
constructors
state of an object
char charAt (int index)
48. Modifier>type/void>identifier>parameters>method body
instance data
method declaration
Scanner scan=new Scanner (System.in);
java.lang package
49. 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
casting
string name;
instance data
long
50. The order in which statements are executed in a running program
java.lang package
flow of control
assignment
boolean equalsIgnoreCase (String str)