Title: Java Final Exam Review
1Java Final Exam Review
2Java Final Exam Review 5.1
- Which statements about class methods are true?
Choose 4 - Instance variables and instance methods cannot be
directly accessed by static methods of the same
class. - Class methods require that no objects of the
class be created in order to use these methods. - The main method is a class method.
- Class methods can access instance data using the
following dot notation (Class_name.instance_variab
le) - Class methods are also known as static methods
- Class methods are also known as instance methods
3Java Final Exam Review 5.2
- How should data that is final and used outside
the object be declared? - Private
- Public
- Package
- Default
4Java Final Exam Review 5.4
- Which items are included in the syntax of the
main method? Choose 4 - The access modifier public
- A single argument that describes a data-type of
int - A variable to store the arguments data, commonly
name args - The qualifier static
- The method name Main
- The return type void
5Java Final Exam Review 5.5
- What should a constant name start with in order
to comply with improved readability issues? - An uppercase letter
- A lowercase letter
- An underline
- A number
6Java Final Exam Review 5.10
- What must all methods have?
- A name and a return type
- A name and an argument
- A qualifier and argument
- A qualifier and a return type
7Java Final Exam Review 5.11
- What is the lifetime of an object or method
variable in Java? - During the compilation process
- Duration of the defining code block
- Duration of the entire program
- During the programming process only
8Java Final Exam Review 5.14
- What should a variable name start with in order
to comply with improved readability issues? - A capital letter
- A lowercase letter
- An underline
- A number
9Java Final Exam Review 5.20
- Which of the following instance variables for
BankAccount would be declared final? - accountBalance
- accountNumberId
- lastDateAccessed
- checkingFee
10Java Final Exam Review 5.22
- Where is the object data stored?
- The heap
- The hard drive
- The stack
- The object store
11Java Final Exam Review 5.24
- When an object of a class is instantiated, what
is needed to work with that object? - A reference for that object
- Data for the object
- Methods for the object
- A constructor
12Java Final Exam Review 4.1
- Which of the following statements regarding shift
operators is true? - The operands should not be an int
- They shift the right operand by the number of
bits specified by the left operand - The operands should be integral types that are
generally int or long - The shift operators include ltlt, ltltlt, gtgt, and gtgtgt
13Java Final Exam Review 4.2
- What does the \u character represent?
- An underline
- The letter u
- The escape sequence to encode a Unicode character
- A newline
14Java Final Exam Review 4.4
- What is the value of x after this statement
executes - Int x 14/5 5
- 14
- 10
- 15
- .56
15Java Final Exam Review 4.5
- The dot operator is used to do which of the
following operations? - The dot operator is used to set an attributes
value. - The dot operator is used to create new object
behaviors. - The dot operator is used to create an object.
- The dot operator is used to access non-private
methods or member data of an object.
16Java Final Exam Review 4.7
- Which of the following is a valid assignment
statement? - Bool done true
- Boolean done true
- Bool done 0
- Boolean done FALSE
17Java Final Exam Review 4.14
- What happens to the sign of a binary number when
a right shift is applied? - The sign bit is replaced by a 1
- The sign bit is replaced by a 0
- The sign bit does not change
- Integers in Java are unsigned so this is not a
concern
18Java Final Exam Review 4.17
- What is the correct syntax for the ternary
operator? - Condition, true, else
- Condition? True value else value
- Condition?, true value, else value
- Condition, true value ,else value
19Java Final Exam Review 4.18
- What are the three control structures in Java?
- Sequence, flow, and decision
- Sequence, selection, and decision
- Sequence, selection, and repetition
- Iteration, decision, and repetition
20Java Final Exam Review 4.21
- Which of the following conversions with
primitives are allowed? - Primitive to boolean
- Boolean to primitive
- Primitive to reference
- Double to float
21Java Final Exam Review 4.22
- What is casting?
- Converting one object type to another type
- Deleting the object
- Accessing the non-private attributes of the
object - Accessing the private attributes of the object
22Java Final Exam Review
23Java Final Exam Review 3.1
- Which of the following integral data types can
store the largest value? - Byte
- Short
- Int
- Long
24Java Final Exam Review 3.2
- What type of memory does Java use to store
objects? - Registers
- Stack
- Heap
- Static storage
25Java Final Exam Review 3.3
- What uses memory space in the processor and
provides the fastest access to the data? - Registers
- Stacks
- Heaps
- Statics
26Java Final Exam Review 3.4
- Which of the following terms refers to the usage
rules for symbols and keywords of a language? - Grammar
- Local
- Syntax
- Constant
27Java Final Exam Review 3.5
- The Java API documentation can be viewed using
which two display methods? - Standard or formatted
- Document or image
- Keyword or boolean
- Frames or no frames
28Java Final Exam Review 3.6
- What refers to the storage area that is used for
allocating memory when the keyword new is used? - Stack
- Heap
- Static storage
- Constant storage
29Java Final Exam Review 3.7
- Which data modifier does Java use to create a
constant? - Final
- Public
- Protected
- Static
30Java Final Exam Review 3.8
- What is the default value for an object
reference? - 0
- False
- Null
- Empty
31Java Final Exam Review 3.9
- What symbols surround statements in a block of
code? - White space
- Commas
- Semicolons
- Braces
32Java Final Exam Review 3.10
- What is the syntax for a single line comment in a
Java source file? - //
- \\
- / /
- \ \
33Java Final Exam Review 2.1
- Which of the following contains the attributes
and behaviors of the object it defines? - Object
- Class
- Attribute
- Data type
- Method
- Behavior
34Java Final Exam Review 2.2
- What is the name of the Java library of classes?
- API
- JVM
- ARI
- JRE
35Java Final Exam Review 2.3
- What is a class?
- A specific instance of an object
- An object identifier
- An object reference
- A blueprint or specification of an object
36Java Final Exam Review 2.4
- The Java language uses keywords to identify
different levels of encapsulation of an object.
Select the keywords that are also often described
as access modifiers. - Private
- Common
- Public
- Protected
- Global
37Java Final Exam Review 3.5
- Which of the following terms refer to a method
that accomplishes a non-standard task in a class? - Mutator method
- Accessor method
- Instance method
- Custom method
38Java Final Exam Review 2.7
- Which terms are used to describe how an object
knows to do things? - Behaviors and methods
- Reference and methods
- Operations and behaviors
- Inheritance and behaviors
39Java Final Exam Review 2.8
- Which term describes a container of data and
instructions for processing that data? - Object
- Class
- Attribute
- Data type
- Method
- Behavior
40Java Final Exam Review 2.9
- One of the first lines of a Java program is the
class definition. Which Java keyword must be
included in the class definition? - Static
- Class
- Final
- Private
41Java Final Exam Review 2.10
- When designing objects, it helps to ask which of
these questions? Select two. - What is the class of the object?
- What are the attributes of the object?
- What are the data types of the object?
- What are the behaviors of the object?
- What is the encapsulation of the object?
42Java Final Exam Review 2.11
- Which acronym below is a collection of symbols
and patterns of symbols used to describe objects,
the relationship between objects, the use of
objects, and the access of objects? - URL
- JVM
- UML
- HTM
- DDC
43Java Final Exam Review 1.1
- Which of the following are used to instruct a
program to perform mathematical calculations or a
test of data? - Keywords
- Identifiers
- Syntax
- operators
44Java Final Exam Review 1.2
- Which program must run in order to run a Java
class file? - The Java compiler
- The code that emulates the Java processor
- The Java Vital Management
- The jar decompression
45Java Final Exam Review 1.3
- Which term describes a programming error that
occurs when a program is executed? - Output error
- Syntax error
- Runtime error
- Input error
- Compiler error
46Java Final Exam Review 1.4
- What are the two categories of software
classification? Choose two - Game
- Operating system
- Internet browser
- Application
- utility
47Java Final Exam Review 1.5
- Which of the following is used to create HTML
documentation for a Java class? - Javac
- Jar
- Jbd
- Javadoc
48Java Final Exam Review 1.6
- Which of the following programming paradigms
requires a programmer to use a linear approach to
software development? - Event driven programming
- Functional programming
- Object oriented programming
- Procedural programming
49Java Final Exam Review 1.8
- Which one of the following keywords is required
when declaring the main method that is the start
of a Java application? - Static
- Class
- Final
- Int
50Java Final Exam Review 1.9
- What are the two ways that different programming
languages use to change source code into machine
language? - Analyze or design
- Compile or execute
- Compile or interpret
- Interpret or execute
51Java Final Exam Review 1.11
- Which of the following could possibly cause a
runtime error? - Misspelled keyword
- Missing semicolon
- Division by zero
- Incorrect class modifier
52Java Final Exam Review 1.12
- Which of the following types of applications is
Java most commonly used to create? - Marketing applications
- Mainframe applications
- E-commerce applications
- Database applications