Java Final Exam Review - PowerPoint PPT Presentation

1 / 52
About This Presentation
Title:

Java Final Exam Review

Description:

Instance variables and instance methods cannot be directly ... The code that emulates the Java processor. The Java Vital Management. The jar decompression ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 53
Provided by: rockfor
Category:
Tags: emulates | exam | final | java | javac | review

less

Transcript and Presenter's Notes

Title: Java Final Exam Review


1
Java Final Exam Review
  • Part I and II

2
Java 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

3
Java Final Exam Review 5.2
  • How should data that is final and used outside
    the object be declared?
  • Private
  • Public
  • Package
  • Default

4
Java 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

5
Java 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

6
Java 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

7
Java 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

8
Java 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

9
Java Final Exam Review 5.20
  • Which of the following instance variables for
    BankAccount would be declared final?
  • accountBalance
  • accountNumberId
  • lastDateAccessed
  • checkingFee

10
Java Final Exam Review 5.22
  • Where is the object data stored?
  • The heap
  • The hard drive
  • The stack
  • The object store

11
Java 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

12
Java 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

13
Java 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

14
Java Final Exam Review 4.4
  • What is the value of x after this statement
    executes
  • Int x 14/5 5
  • 14
  • 10
  • 15
  • .56

15
Java 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.

16
Java 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

17
Java 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

18
Java 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

19
Java 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

20
Java 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

21
Java 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

22
Java Final Exam Review
  • Part II

23
Java Final Exam Review 3.1
  • Which of the following integral data types can
    store the largest value?
  • Byte
  • Short
  • Int
  • Long

24
Java Final Exam Review 3.2
  • What type of memory does Java use to store
    objects?
  • Registers
  • Stack
  • Heap
  • Static storage

25
Java Final Exam Review 3.3
  • What uses memory space in the processor and
    provides the fastest access to the data?
  • Registers
  • Stacks
  • Heaps
  • Statics

26
Java 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

27
Java 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

28
Java 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

29
Java Final Exam Review 3.7
  • Which data modifier does Java use to create a
    constant?
  • Final
  • Public
  • Protected
  • Static

30
Java Final Exam Review 3.8
  • What is the default value for an object
    reference?
  • 0
  • False
  • Null
  • Empty

31
Java Final Exam Review 3.9
  • What symbols surround statements in a block of
    code?
  • White space
  • Commas
  • Semicolons
  • Braces

32
Java Final Exam Review 3.10
  • What is the syntax for a single line comment in a
    Java source file?
  • //
  • \\
  • / /
  • \ \

33
Java 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

34
Java Final Exam Review 2.2
  • What is the name of the Java library of classes?
  • API
  • JVM
  • ARI
  • JRE

35
Java 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

36
Java 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

37
Java 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

38
Java 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

39
Java 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

40
Java 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

41
Java 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?

42
Java 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

43
Java 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

44
Java 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

45
Java 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

46
Java Final Exam Review 1.4
  • What are the two categories of software
    classification? Choose two
  • Game
  • Operating system
  • Internet browser
  • Application
  • utility

47
Java Final Exam Review 1.5
  • Which of the following is used to create HTML
    documentation for a Java class?
  • Javac
  • Jar
  • Jbd
  • Javadoc

48
Java 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

49
Java 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

50
Java 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

51
Java 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

52
Java 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
Write a Comment
User Comments (0)
About PowerShow.com