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. 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:
state of an object
byte to short
variable name
num=Integer.parseInt(str);
2. If a class contains the _________ height - it should also probably contain the methods: getHeight and setHeight
flow of control
support methods
character literal
instance variable
3. format for constants: all upper-case; separated by ________
underscores
instance variable
byte nextByte( )
String format (double number)
4. The only purpose of a private method is to help other methods of the class do their job. they are referred to as _________
a constructor
local data
support methods
floating point numbers
5. 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
literal
instance data
reserved word void
Scanner class
6. 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
conditionals
Scanner scan=new Scanner (System.in);
behaviors of an object
wrapper class
7. Returns the next input token as a character string.
method invocation
String next( )
double
assignment statement
8. Variables that don't contain any data
Scanner useDelimiter(String pattern)
the DecimalFormat class
uninitialized variables
signed
9. Making it difficult - if not impossible - for code outside of a class to "reach in" and chnage the value of a variable that is declared inside that class.
encapsulation
tokens
String format (double number)
String toUpperCase ( )
10. Boolean type conversions are ___________
tokens
not possible
encapsulation of an object
pointer
11. Methods in the Math class are ______
set
String object
flow of control
static
12. ______________ operators have higher precedence
delimiters
arithmetic
int length( )
literal
13. System.out object represents an output device or file; we send the println message to the System.out object to request that some text be printed
reserved word void
System.out.println
String toUpperCase ( )
byte nextByte( )
14. A variable that refers to an object must be __________
declared
support methods
java.lang package
parameter
15. Even though a method may not take parameters - _________ are still necessary to indicate that a method is being invoked
formal parameters
aliases
parentheses
data values
16. Returns a new string that is identical with this string except that every occurrence of oldChar is replaed by newChar
data values
String replace (char oldChar - char newChar)
Scanner useDelimiter(String pattern)
class level
17. Constructor: creates a new string object with the same characters as str.
enumerated type
String (String str)
instance data
header of a method
18. A class usually provides services to access and modify __________
a constructor
data values
underscores
accessor method
19. New memory space is reserved for that variable every time an instance of the class that is created.
underscores
instance data
boolean nextBoolean( )
String format (double number)
20. Cast operator has _________ precedence to division
higher
RH
enumerated type
String format (double number)
21. 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
packages
wrapper class
string name;
byte nextByte( )
22. They clarify the role a certain number has in the program.
expression
instance data
Random class
constants
23. 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
parameter
String toUpperCase ( )
method invocation
String next( )
24. Sets the scanner's delimiting pattern.
enumerated type
promotion
boolean equals (String str)
Scanner useDelimiter(String pattern)
25. Returns a new string that is a subset of this string starting at index offset and extending through endIndx-1;
declared
String substring (int offset - int endIndex)
variable
String concat (String str)
26. A set of classes that supports the development of programs
class library
static
operations
Random class
27. All wrapper classes are defined in ___________
static
java.lang package
declared
int compareTo (String str)
28. The values passed into a method in an invocation; these are called the arguments to the method
char charAt (int index)
primitive variables
actual parameters
method invocation
29. ++count; -- count
public
prefix form
inheritance
polymorphism
30. 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.
data values
parameter list
String object
class library
31. Four integer data types: byte - short - int - _____
RH
long
constructors
String findInLine (String pattern)
32. Two floating data types: float - _______
String concat (String str)
double
Scanner scan=new Scanner (System.in);
visibility modifiers
33. Provides generic formatting capabilities for numbers; you don't instantiate a NumberFormat object by using the "new" operator.
operations
have void
NumberFormat class
Random ( )
34. When a variable is declared inside a method
flow of control
local data
Scanner useDelimiter(String pattern)
delimiters
35. 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
reference
variable name
inheritance
variable declaration
36. An object in Java - defined by the class String
header of a method
encapsulation of an object
assignment conversion
character string
37. 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
escape sequences
attributes of an object
byte nextByte( )
uninitialized variables
38. A null reference indicates that a variable does not refer to an object
floating point numbers
boolean nextBoolean( )
arithmetic
null
39. 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.
visibility modifiers
data values
literal
String replace (char oldChar - char newChar)
40. Returns the int corresponding to the value stored in the specified string
static int parseInt (String str)
higher
set
variable
41. 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
java.lang package
packages
Understanding
variable
42. An object has behaviors - which are defined by the ________ associated with that object.
self-governing
operations
underscores
constants
43. Widening byte: _________ - to int - to long - to float - to double
byte to short
variable
state of an object
String format (double number)
44. 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.
declared
set
long
polymorphism
45. Each piece of data that we send to a method
Scanner scan=new Scanner (System.in);
Scanner class
parameter
instance variable
46. Changes a particular value - e.g.setX - where X is the value they are setting.
not possible
parameter
mutator method
string literal
47. Returns true if the scanner has anotehr token in its input.
boolean nextBoolean( )
java.util class libary
class
boolean hasNext( )
48. 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
encapsulation of an object
a constructor
variable declaration
polymorphism
49. Automatically imported because they are fundamental and can be thought of as basic extensions to the language.
uninitialized variables
java.lang package
casting
arithmetic
50. Delimited by double quotation characters
instantiation
wrapper class
postfix form
string literal
Sorry!:) No result found.
Can you answer 50 questions in 15 minutes?
Let me suggest you:
Browse all subjects
Browse all tests
Most popular tests
Major Subjects
Tests & Exams
AP
CLEP
DSST
GRE
SAT
GMAT
Certifications
CISSP go to https://www.isc2.org/
PMP
ITIL
RHCE
MCTS
More...
IT Skills
Android Programming
Data Modeling
Objective C Programming
Basic Python Programming
Adobe Illustrator
More...
Business Skills
Advertising Techniques
Business Accounting Basics
Business Strategy
Human Resource Management
Marketing Basics
More...
Soft Skills
Body Language
People Skills
Public Speaking
Persuasion
Job Hunting And Resumes
More...
Vocabulary
GRE Vocab
SAT Vocab
TOEFL Essential Vocab
Basic English Words For All
Global Words You Should Know
Business English
More...
Languages
AP German Vocab
AP Latin Vocab
SAT Subject Test: French
Italian Survival
Norwegian Survival
More...
Engineering
Audio Engineering
Computer Science Engineering
Aerospace Engineering
Chemical Engineering
Structural Engineering
More...
Health Sciences
Basic Nursing Skills
Health Science Language Fundamentals
Veterinary Technology Medical Language
Cardiology
Clinical Surgery
More...
English
Grammar Fundamentals
Literary And Rhetorical Vocab
Elements Of Style Vocab
Introduction To English Major
Complete Advanced Sentences
Literature
Homonyms
More...
Math
Algebra Formulas
Basic Arithmetic: Measurements
Metric Conversions
Geometric Properties
Important Math Facts
Number Sense Vocab
Business Math
More...
Other Major Subjects
Science
Economics
History
Law
Performing-arts
Cooking
Logic & Reasoning
Trivia
Browse all subjects
Browse all tests
Most popular tests