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 method that returns a value must have a _________
return statement
character literal
flow of control
String nextLine( )
2. 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.
conditionals
reserved word void
encapsulation of an object
null
3. The declarations of object variables have a similar structure to the declaration of _______________
floating point numbers
primitive variables
expression
variable declaration
4. Returns a string containing the specified number formatted according to this object's pattern.
packages
String format (double number)
formal parameters
service methods
5. ____________ is instantiated in the traditional way using the new operator.
the DecimalFormat class
String (String str)
Scanner scan=new Scanner (System.in);
primitive variables
6. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
initialize
String replace (char oldChar - char newChar)
formal parameters
have void
7. Returns a new string consisting of this string concatenated with str.
boolean equals (String str)
arithmetic
boolean hasNext( )
static int parseInt (String str)
8. 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
support methods
pointer
not possible
conditional statement
9. Attempts to find the next occurence of the specified pattern - ignoring delimiters
character literal
scope
String findInLine (String pattern)
instantiation
10. Elements of input
instantiation
visibility modifiers
tokens
RH
11. ______________ operators have higher precedence
assignment
local data
arithmetic
return statement
12. An object has behaviors - which are defined by the ________ associated with that object.
enumerated type
the "import" declaration
operations
dot operator
13. Represents either a primitive value or an object
variable name
polymorphism
have void
signed
14. Boolean type conversions are ___________
long
not possible
formal parameters
constructors
15. Defined and then used as the type of a variable when it is declared; establishes all possible values of a variable of that type by listing - or enumerating - them.
conditional statement
null
data values
enumerated type
16. After an object has been instantiated - we set the _________ to access its methods
dot operator
RH
delimiters
public
17. This declaration creates a Scanner object that reads input from the keyboard
packages
Scanner scan=new Scanner (System.in);
assignment
primitive variables
18. 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
operations
called method
System.out.println
variable declaration
19. sides=10;
method declaration
service methods
aliases
assignment statement
20. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
pointer
accessor method
null
primitive variables
21. Returns the number of characters in this stirng.
actual parameters
parentheses
int length( )
boolean hasNext( )
22. A class usually provides services to access and modify __________
casting
data values
Random ( )
packages
23. 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
string name;
method declaration
initialize
RH
24. Also called a selection statement b/c it allows us to choose which statement will be executed next.
conditional statement
casting
static int parseInt (String str)
scope
25. Widening byte: _________ - to int - to long - to float - to double
postfix form
byte to short
variable name
operations
26. Each piece of data that we send to a method
num=Integer.parseInt(str);
char charAt (int index)
flow of control
parameter
27. The fundamental characteristics that currently define the object. for example - part of a bank account's state is its current balance.
System.out.println
autoboxing
state of an object
String (String str)
28. Constructor: creates a new pseudorandom number generator.
operations
set
Random ( )
variable declaration
29. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
static int parseInt (String str)
int compareTo (String str)
boolean nextBoolean( )
reference
30. 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.
scope
actual parameters
String (String str)
Random class
31. The idea that we can refer to multiple types of related objects over time in consistent ways. it gives us the ability to design powerful and elegant solutions to problems that deal with multiple objects.
polymorphism
parentheses
encapsulation of an object
java.lang package
32. Returns the character at the specified index.
method declaration
declared
char charAt (int index)
parentheses
33. Expressed in a Java program with single quotes
variable name
literal
character literal
conditional statement
34. A null reference indicates that a variable does not refer to an object
conditional statement
byte to short
null
private
35. The Scanner class is part of ___________________
encapsulation of an object
NumberFormat class
java.util class libary
header of a method
36. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
Random ( )
boolean equalsIgnoreCase (String str)
character literal
promotion
37. Changes a particular value - e.g.setX - where X is the value they are setting.
visibility modifiers
mutator method
Understanding
constants
38. Returns the next input token as the indicated type.
boolean nextBoolean( )
parentheses
scope
postfix form
39. format for constants: all upper-case; separated by ________
set
boolean hasNext( )
mutator method
underscores
40. Allows all classes in the java.util package to be referenced in the program without qualfying each reference.
instantiation
floating point numbers
import java.util*
prefix form
41. ++count; -- count
parentheses
prefix form
Scanner useDelimiter(String pattern)
enumerated type
42. 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 replace (char oldChar - char newChar)
assignment conversion
aliases
formal parameters
43. Instance data should be defined with what________ visibility
enumerated type
have void
private
static int parseInt (String str)
44. Eight primitive data types: four subsets of integers - two subsets of ________ - a character data type - and a boolean data type
floating point numbers
static
prefix form
class library
45. 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
support methods
postfix form
method
String substring (int offset - int endIndex)
46. All numeric types are _______ - meaning both positive and negative values can be stored in them
signed
flow of control
null
character string
47. 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 -
arithmetic
class
self-governing
enumerated type
48. Returns a new string consisting of this string concatenated with str.
String concat (String str)
boolean equalsIgnoreCase (String str)
boolean value
NumberFormat class
49. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
local data
header of a method
constructors
encapsulation
50. They clarify the role a certain number has in the program.
constructors
boolean equalsIgnoreCase (String str)
constants
parameter