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. 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.
attributes of an object
enumerated type
int compareTo (String str)
literal
2. The Scanner class is part of ___________________
string literal
have void
java.util class libary
variable
3. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
String replace (char oldChar - char newChar)
data values
assignment statement
header of a method
4. After an object has been instantiated - we set the _________ to access its methods
the DecimalFormat class
set
literal
dot operator
5. 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
boolean equals (String str)
boolean equalsIgnoreCase (String str)
int length( )
6. Constructor: creates a new string object with the same characters as str.
private
attributes of an object
instantiation
String (String str)
7. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
java.lang package
reserved word void
uninitialized variables
actual parameters
8. Changes a particular value - e.g.setX - where X is the value they are setting.
mutator method
have void
promotion
byte to short
9. sides=10;
int compareTo (String str)
assignment statement
self-governing
support methods
10. Attempts to find the next occurence of the specified pattern - ignoring delimiters
accessor method
String findInLine (String pattern)
long
initialize
11. The classes of the Java standard class library are grouped into __________.
packages
attributes of an object
accessor method
String substring (int offset - int endIndex)
12. Instance data should be defined with what________ visibility
reference
formal parameters
conditionals
private
13. Each piece of data that we send to a method
NumberFormat class
parameter
prefix form
System.out.println
14. Expressed in a Java program with single quotes
character literal
method invocation
class
boolean nextBoolean( )
15. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
static int parseInt (String str)
parentheses
String object
character literal
16. Constructor: creates a new pseudorandom number generator.
variable declaration
String nextLine( )
service methods
Random ( )
17. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
method declaration
service methods
class library
instance data
18. The automatic conversion between a primitive value and a corresponding wrapper object.
state of an object
header of a method
class level
autoboxing
19. Three ways in which Java conversions occur: _________ conversion - promotion - casting
assignment
instance data
boolean equals (String str)
state of an object
20. A variable that refers to an object must be __________
floating point numbers
num=Integer.parseInt(str);
java.lang package
declared
21. Occurs automatically when certain operators need to modify their opeands in order to perform the operation
parentheses
scope
String findInLine (String pattern)
promotion
22. A value that is passed into a method when it is invoked
variable declaration
Scanner useDelimiter(String pattern)
method invocation
parameter
23. A null reference indicates that a variable does not refer to an object
primitive variables
delimiters
null
dot operator
24. 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
formal parameters
parameter
encapsulation of an object
string name;
25. The order in which statements are executed in a running program
boolean hasNext( )
state of an object
flow of control
not possible
26. Elements of input
tokens
dot operator
polymorphism
inheritance
27. An object in Java - defined by the class String
character string
prefix form
set
header of a method
28. An object should be self-governing - meaning that the instance data of an object should be modified only by that object.
data values
variable declaration
self-governing
assignment
29. ______________ operators have higher precedence
Scanner useDelimiter(String pattern)
arithmetic
String findInLine (String pattern)
expression
30. The act of creating an object using the "new" operator
double
local data
instantiation
set
31. 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
boolean hasNext( )
String object
null
32. 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
variable declaration
visibility modifiers
method invocation
prefix form
33. This declaration creates a Scanner object that reads input from the keyboard
Scanner scan=new Scanner (System.in);
java.lang package
casting
static int parseInt (String str)
34. A method that returns a value must have a _________
return statement
postfix form
boolean equals (String str)
import java.util*
35. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
method invocation
polymorphism
instance variable
parameter
36. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
the DecimalFormat class
method declaration
int compareTo (String str)
reference
37. We use an object when we have a _________ to it
return statement
reference
literal
not possible
38. Returns the next input token as the indicated type.
have void
assignment statement
parameter
byte nextByte( )
39. Returns a new string consisting of this string concatenated with str.
instantiation
operations
String object
boolean equals (String str)
40. Returns the next input token as the indicated type.
string name;
boolean nextBoolean( )
escape sequences
System.out.println
41. Examples of Scanner ________: Scanner (InputStream source) - Scanner(File source) - Scanner(String source)
String toLowerCase ( )
constructors
service methods
formal parameters
42. Begins with a backslash character ""
not possible
escape sequences
pointer
operations
43. 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
a constructor
wrapper class
String nextLine( )
constructors
44. They clarify the role a certain number has in the program.
String next( )
constants
String substring (int offset - int endIndex)
Scanner scan=new Scanner (System.in);
45. 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
String nextLine( )
header of a method
String (String str)
Understanding
46. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
underscores
class
wrapper class
String substring (int offset - int endIndex)
47. 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
postfix form
Random class
method
underscores
48. 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
String (String str)
enumerated type
behaviors of an object
Scanner class
49. 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
scope
boolean value
java.lang package
variable
50. Sets the scanner's delimiting pattern.
Scanner useDelimiter(String pattern)
signed
constants
boolean nextBoolean( )