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. 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
called method
inheritance
reference
expression
2. Returns the next input token as the indicated type.
boolean nextBoolean( )
null
enumerated type
character string
3. Provides read-only access to a particular value - e.g. getX where X is the value to which it provides access.
accessor method
flow of control
static int parseInt (String str)
a constructor
4. 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
System.out.println
casting
class
Random ( )
5. Constants are ______ because the can't be changed once you use the final modifier
public
constants
String substring (int offset - int endIndex)
boolean nextBoolean( )
6. 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
boolean hasNext( )
header of a method
reference
attributes of an object
7. Part of the java.util class; picks a number at random out of a range of values.
declared
instantiation
a constructor
Random class
8. Four integer data types: byte - short - int - _____
literal
long
public
variable
9. 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
Understanding
String findInLine (String pattern)
service methods
expression
10. 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
char charAt (int index)
boolean value
RH
parameter
11. The names of the parameters in the header of the method declaration
RH
String object
formal parameters
method invocation
12. A value that is passed into a method when it is invoked
String concat (String str)
parameter
String (String str)
String findInLine (String pattern)
13. Returns the number of characters in this stirng.
method invocation
boolean equalsIgnoreCase (String str)
int length( )
primitive variables
14. Expressed in a Java program with single quotes
character literal
java.util class libary
conditional statement
constructors
15. _____ expression evaluated first
String findInLine (String pattern)
RH
the "import" declaration
instance variable
16. Returns a new string consisting of this string concatenated with str.
conditionals
String findInLine (String pattern)
boolean nextBoolean( )
String concat (String str)
17. Variables and constants can be referenced in any method of the class by declaring at the _________
attributes of an object
encapsulation
class level
formal parameters
18. When two variables contain the same address and therefore refer to the same object; one important implication of _________ is that when we use one ref to change an object - it is also changed for the other reference because there is really only one o
class level
aliases
Scanner scan=new Scanner (System.in);
arithmetic
19. Every object has two things: a state and a _____ of behaviors
actual parameters
boolean equalsIgnoreCase (String str)
set
String nextLine( )
20. Elements of input
string name;
postfix form
Scanner scan=new Scanner (System.in);
tokens
21. Returns a string containing the specified number formatted according to this object's pattern.
String format (double number)
private
boolean value
signed
22. Returns an integer indicating if this string is lexically before - equal to - or lexically after the string str.
num=Integer.parseInt(str);
behaviors of an object
parameter
int compareTo (String str)
23. Constructors do not even _______; therefore they cannot return a value.
have void
RH
polymorphism
Understanding
24. Methods that provide services to the client must be declared with public visibility so that they can be invoked by the client.
encapsulation
conditional statement
service methods
reference
25. New memory space is reserved for that variable every time an instance of the class that is created.
scope
boolean value
escape sequences
instance data
26. Cast operator has _________ precedence to division
higher
public
uninitialized variables
class
27. Count++; count--
method
packages
service methods
postfix form
28. A null reference indicates that a variable does not refer to an object
java.lang package
Understanding
uninitialized variables
null
29. Changes a particular value - e.g.setX - where X is the value they are setting.
pointer
casting
mutator method
dot operator
30. The act of creating an object using the "new" operator
String nextLine( )
instantiation
String substring (int offset - int endIndex)
accessor method
31. 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.
reserved word void
tokens
Understanding
String toLowerCase ( )
32. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
packages
accessor method
boolean hasNext( )
String replace (char oldChar - char newChar)
33. Begins with a backslash character ""
String replace (char oldChar - char newChar)
escape sequences
autoboxing
parameter list
34. 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
NumberFormat class
conditionals
signed
Understanding
35. The order in which statements are executed in a running program
constructors
long
flow of control
tokens
36. All numeric types are _______ - meaning both positive and negative values can be stored in them
String replace (char oldChar - char newChar)
flow of control
delimiters
signed
37. The one that is invoked
header of a method
encapsulation
called method
polymorphism
38. 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
string name;
variable declaration
assignment conversion
String toLowerCase ( )
39. 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.
dot operator
primitive variables
encapsulation
polymorphism
40. 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
autoboxing
character literal
null
wrapper class
41. sides=10;
conditionals
boolean equalsIgnoreCase (String str)
assignment statement
method
42. An object in Java - defined by the class String
visibility modifiers
System.out.println
character string
String format (double number)
43. An object has behaviors - which are defined by the ________ associated with that object.
operations
String substring (int offset - int endIndex)
instance data
java.lang package
44. Includes the type of teh return value - the method name - and the list of parameters that the method accepts.
String next( )
header of a method
attributes of an object
parentheses
45. Boolean type conversions are ___________
formal parameters
not possible
assignment conversion
state of an object
46. The declarations of object variables have a similar structure to the declaration of _______________
formal parameters
class level
primitive variables
boolean equalsIgnoreCase (String str)
47. Widening byte: _________ - to int - to long - to float - to double
declared
Understanding
constants
byte to short
48. Constructor: creates a new pseudorandom number generator.
visibility modifiers
Random ( )
expression
escape sequences
49. Returns true if this string contains the same characters as str (without regard to case) and false otherwise.
mutator method
java.util class libary
int compareTo (String str)
boolean equalsIgnoreCase (String str)
50. 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
primitive variables
method invocation
have void
literal