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. Widening byte: _________ - to int - to long - to float - to double
string name;
byte to short
String nextLine( )
data values
2. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
escape sequences
char charAt (int index)
parentheses
pointer
3. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
declared
parameter
return statement
constructors
4. Expressed in a Java program with single quotes
support methods
double
higher
character literal
5. ++count; -- count
instance variable
uninitialized variables
prefix form
set
6. Returns the int corresponding to the value stored in the specified string
self-governing
static int parseInt (String str)
polymorphism
higher
7. 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
delimiters
int compareTo (String str)
boolean nextBoolean( )
attributes of an object
8. 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
reserved word void
String nextLine( )
variable declaration
local data
9. A method that returns a value must have a _________
autoboxing
return statement
java.util class libary
parameter list
10. Returns the character at the specified index.
private
Scanner useDelimiter(String pattern)
char charAt (int index)
null
11. Begins with a backslash character ""
escape sequences
header of a method
formal parameters
instance data
12. An explicit data value used in a program
literal
formal parameters
local data
arithmetic
13. When a variable is declared inside a method
initialize
pointer
local data
inheritance
14. Returns the next input token as the indicated type.
return statement
autoboxing
boolean nextBoolean( )
variable declaration
15. 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
boolean equals (String str)
formal parameters
NumberFormat class
16. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
System.out.println
public
support methods
a constructor
17. 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
casting
encapsulation
String toUpperCase ( )
instantiation
18. Methods in the Math class are ______
static
flow of control
reference
actual parameters
19. Each piece of data that we send to a method
parameter
escape sequences
java.lang package
character string
20. Constants are ______ because the can't be changed once you use the final modifier
public
escape sequences
tokens
String substring (int offset - int endIndex)
21. An object in Java - defined by the class String
floating point numbers
scope
instance data
character string
22. A class usually provides services to access and modify __________
String nextLine( )
parameter
assignment
data values
23. The values passed into a method in an invocation; these are called the arguments to the method
data values
not possible
actual parameters
scope
24. Cast operator has _________ precedence to division
tokens
double
variable name
higher
25. Returns the next input token as the indicated type.
mutator method
String format (double number)
byte nextByte( )
public
26. This declaration creates a Scanner object that reads input from the keyboard
boolean nextBoolean( )
static int parseInt (String str)
Scanner scan=new Scanner (System.in);
byte to short
27. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
Random class
String substring (int offset - int endIndex)
instance variable
dot operator
28. Instance data should be defined with what________ visibility
private
java.lang package
literal
variable
29. 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 literal
String object
Scanner class
30. 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
assignment
variable name
literal
a constructor
31. A null reference indicates that a variable does not refer to an object
boolean hasNext( )
the DecimalFormat class
null
mutator method
32. The order in which statements are executed in a running program
mutator method
flow of control
instance variable
primitive variables
33. Constructor: creates a new string object with the same characters as str.
variable declaration
Random ( )
String (String str)
character string
34. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
String toLowerCase ( )
instantiation
NumberFormat class
constants
35. A group of programming statements that is given a name. when a method is invoked - its statements are executed. a set of methods is associated with an object and defines its potential behaviors. to define the ability to make a deposit into a bank acc
aliases
assignment conversion
reference
method
36. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
method
assignment
class library
java.lang package
37. 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
int compareTo (String str)
conditional statement
tokens
Understanding
38. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
arithmetic
higher
self-governing
String replace (char oldChar - char newChar)
39. ____________ is instantiated in the traditional way using the new operator.
the DecimalFormat class
not possible
java.lang package
RH
40. How classes are created from other classes. the definition of one class can be based on another class that already exists. inheritance is a form of software reuse - capitalizing on the similarities between various kinds of classes that we want to cre
floating point numbers
String toLowerCase ( )
inheritance
encapsulation of an object
41. 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
method invocation
have void
initialize
polymorphism
42. 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
service methods
tokens
43. They clarify the role a certain number has in the program.
constants
parameter
dot operator
arithmetic
44. ______________ operators have higher precedence
double
boolean value
arithmetic
dot operator
45. Sets the scanner's delimiting pattern.
assignment statement
parameter
Scanner useDelimiter(String pattern)
Random ( )
46. A value that is passed into a method when it is invoked
parameter
parameter list
local data
conditional statement
47. A ________________ is immutable.
private
Understanding
String object
inheritance
48. 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.
int length( )
String format (double number)
underscores
parameter list
49. 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
class level
instance data
signed
encapsulation of an object
50. Returns a new string consisting of this string concatenated with str.
flow of control
encapsulation of an object
boolean equalsIgnoreCase (String str)
boolean equals (String str)