Advanced Programming with Java Exam Materials - 870 Verified Questions

Page 1


Advanced Programming with Java Exam

Materials

Course Introduction

Advanced Programming with Java is designed to deepen students' knowledge of the Java programming language by exploring complex concepts such as multithreading, network programming, graphical user interface (GUI) development, and design patterns. The course emphasizes object-oriented programming principles and equips students with the skills needed to build robust, efficient, and scalable applications. Through hands-on projects and real-world case studies, students gain practical experience in developing software solutions ranging from desktop applications to enterprise-level systems, preparing them for advanced roles in software development.

Recommended Textbook

Data Abstraction and Problem Solving with Java Walls and Mirrors 3rd Edition by Janet Prichard

Available Study Resources on Quizplus

15 Chapters

870 Verified Questions

870 Flashcards

Source URL: https://quizplus.com/study-set/2590 Page 2

Chapter 1: Review of Java Fundamentals

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51576

Sample Questions

Q1) Suppose s1 is a String variable.We want to check to see if the first and last characters of s1 are the same.Complete the following if-statement to accomplish the task. boolean same; if (______________________________________________) same = true; else same = false; Answer: s1.charAt(0)== s1.charAt(s1.length()- 1)

Q2) Which of these is not a legal Java identifier?

A)2be B)to_be

C)TOBE

D)tobE

Answer: A

Q3) If s = "hello,world" (with exactly one space between the comma and 'w'),what does s.indexOf(",")return?

Answer: 5

To view all questions and flashcards with answers, click on the resource link above.

Page 3

Chapter 2: Principles of Programming and Software Engineering

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51577

Sample Questions

Q1) A(n)______ is a construct that can be defined to store a collection of data.

A)data structure

B)module

C)abstract data type

D)method

Answer: A

Q2) Which of the following is an example of a syntax error?

A)a program encounters an instruction to divide by zero

B)an array subscript in a program goes out of range

C)the beginning of a while loop is written as "whille" instead of "while"

D)an algorithm that calculates the monthly payment of a loan displays incorrect results

Answer: C

Q3) Coding is a relatively minor phase in the software life cycle.

A)True

B)False

Answer: True

Q4) What is meant by procedural abstraction?

Answer: Procedural abstraction refers to separating the purpose of a method from its implementation. To

Chapter 3: Recursion: the Mirrors

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51578

Sample Questions

Q1) In the box trace,each box roughly corresponds to a(n)______.

A)recursive relation

B)activation record

C)base case

D)pivot item

Answer: B

Q2) How many bases cases will be required in a recursive solution that solves a problem by solving two smaller problems of the same type?

A)0

B)1

C)2

D)3

Answer: C

Q3) A recursive binary search algorithm always reduces the problem size by ______ at each recursive call.

A)1

B)2

C)half

D)one-third

Answer: C

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Data Abstraction: The Walls

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51579

Sample Questions

Q1) To ______ an exception means to deal with the error condition. A)throw B)catch C)implement

D)declare

Q2) The definition of a subclass includes a(n)______ clause to indicate its superclass.

A)extends B)super C)this D)implements

Q3) In the following list: John,Kate,Fred,Mark,Jon,Adam,Drew

Which element is the head of the list?

A)John

B)Mark

C)Drew

D)Adam

Q4) What are exceptions used for?

Q5) Give three examples of ADT operations that ask questions about the data in a collection.

To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: Linked Lists

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51580

Sample Questions

Q1) In Java,every class is ultimately derived from the class _____ through inheritance.

A)String

B)Object

C)Math

D)Exception

Q2) Each node in a linear linked list references both its predecessor and its successor.

A)True

B)False

Q3) Which of the following is NOT true about all circular linked lists?

A)every node references a successor

B)the last node references the first node

C)the precede reference of each node references the node that precedes it

D)no node contains null in its next reference

Q4) What are two advantages of using a reference-based implementation of the ADT list instead of an array-based implementation?

Q5) Write the code fragment to delete the node that the reference variable curr references in a circular doubly linked list?

To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: Problem Solving With Abstract Data Types

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51581

Sample Questions

Q1) Describe in your own words the language defined by this recursive definition:

< S > = @ | < W > | @ < S >

< W > = aab | aa < W > b

Q2) Which of the following is NOT a valid postfix expression?

A)a b c - d *

B)a b - c d + -

C)a b c + /

D)a b * c + d *

Q3) What is a prefix expression?

Q4) What is the value of the infix expression: 8 * (5 - 2)?

A)16

B)24

C)38

D)40

Q5) Which of the following is true about algebraic expressions?

A)parentheses are needed in all algebraic expressions

B)infix expressions do not require precedence rules

C)postfix expressions do not require association rules

D)fully parenthesized expressions are difficult to recognize and evaluate

Q6) What is a closed-form formula?

Page 8

To view all questions and flashcards with answers, click on the resource link above.

Chapter 7: Stacks

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51582

Sample Questions

Q1) What are the three facts about converting from infix expressions to postfix expressions?

Q2) Suppose an infix expression contains parentheses as grouping symbols.Is it still possible to convert this expression into postfix notation?

Q3) Which of the following methods of the ADT stack accepts a parameter?

A)push

B)pop

C)createStack

D)peek

Q4) What is the difference between the stack pop and peek operations?

Q5) If a stack is used in a nonrecursive solution to the HPAir problem,when is it necessary to backtrack from a city?

Q6) Write the axiom for specifying that the last item inserted into a stack is the first item to be removed.

Q7) Calls to methods that throw StackException must be enclosed in try blocks. A)True B)False

Q8) What is a directed path?

Q9) What is meant by the last-in,first-out (LIFO)property?

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: Queues

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51583

Sample Questions

Q1) New items enter a queue at its front.

A)True

B)False

Q2) Which of the following is NOT an ADT queue operation?

A)enqueue

B)isEmpty

C)pop

D)peek

Q3) Write the code fragment to insert the item newItem into a queue that is represented by a circular array.

Q4) Operations on a queue can be carried out at ______.

A)its front only

B)its back only

C)both its front and back

D)any position in the queue

Q5) A queue can be used to preserve the order of occurrences.

A)True

B)False

Q6) What is the goal of a simulation?

Q7) What is an event-driven simulation?

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Advanced Java Topics

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51584

Sample Questions

Q1) When is a method in a subclass said to override a method in the superclass?

Q2) ______ enables the reuse of existing classes.

A)Encapsulation

B)Inheritance

C)Polymorphism

D)Simulation

Q3) A subclass inherits all of the following members of its superclass EXCEPT ______.

A)public methods

B)data fields

C)constructors

D)protected methods

Q4) Can the object type of an argument in the call to a method be difference from the object type of the corresponding formal parameter? Explain.

Q5) Inheritance should not be used to implement a has-a relationship.

A)True

B)False

Q6) A package cannot contain other packages.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Algorithm Efficiency and Sorting

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51585

Sample Questions

Q1) The selection sort is continued until ______ of the n items in an array have been swapped.

A)n/2

B)n - 2

C)n - 1

D)n

Q2) Given the following array: 4 15 8 3 28 21

Which of the following represents the array after the second swap of the selection sort? A)4 3 8 15 21 28

Q3) Which of the following is NOT part of the human cost of developing a computer program?

A)the efficiency of a program

B)the readability of a program

C)the modifiability of a program

D)the maintainability a program

Q4) How does the quicksort partition an array?

To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 11: Trees

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51586

Sample Questions

Q1) The ______ of a tree is the number of nodes on the longest path from the root to a leaf.

A)height

B)length

C)width

D)age

Q2) A node of a tree is called a(n)______.

A)edge

B)root

C)branch

D)vertex

Q3) The ADT binary search tree is value-oriented.

A)True

B)False

Q4) What are the characteristics of a binary tree?

Q5) In postorder traversal,what is the order of visiting a node and its subtrees?

Q6) In preorder traversal,what is the order of visiting a node and its subtrees?

Q7) Define an n-ary tree.

Page 13

Q8) Define the left child of node n in a binary tree.

Q9) What is a subtree?

To view all questions and flashcards with answers, click on the resource link above.

Page 14

Chapter 12: Tables and Priority Queues

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51587

Sample Questions

Q1) How does the pqDelete operation work in a linear implementation of the priority queue based on a linked list?

Q2) The sorted reference-based implementation of the tableInsert operation is ______.

A)O(1)

B)O(n)

C)O(n²)

D)O(log n)

Q3) What is the major advantage that a heap implementation of a priority queue has over a binary search tree implementation?

Q4) The ADT table is also known as a ______.

A)map

B)queue

C)heap

D)dictionary

Q5) For what kinds of situations is a linear implementation of the ADT table more efficient than a binary search tree implementation?

Q6) In an array-based implementation of the priority queue,where is the item with the highest priority value located?

To view all questions and flashcards with answers, click on the resource link above. Page 15

Chapter 13: Advanced Implementations of Tables

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51588

Sample Questions

Q1) The maximum height of a binary search tree of n nodes is ______.

A)n

B)n - 1

C)n / 2

D)log2(n + 1)

Q2) The height of a binary tree is sensitive to the order in which items are inserted into the tree.

A)True

B)False

Q3) ______ is a collision-resolution scheme that uses an array of linked lists as a hash table.

A)Linear probing

B)Double hashing

C)Quadratic probing

D)Separate chaining

Q4) What is a collision?

Q5) A red-black representation of a 2-3-4 tree is unique.

A)True

B)False

Q6) What is a bucket?

Page 16

To view all questions and flashcards with answers, click on the resource link above.

Chapter 14: Graphs

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/51589

Sample Questions

Q1) A connected undirected graph that has n vertices and exactly n - 1 edges ______.

A)cannot contain a cycle

B)must contain at least one cycle

C)can contain at most two cycles

D)must contain at least two cycles

Q2) If there is a directed edge from vertex x to vertex y,which of the following can be concluded about x and y?

A)y is a predecessor of x

B)x is a successor of y

C)x is adjacent to y

D)y is adjacent to x

Q3) What is a weighted graph?

Q4) What is the shortest path between two vertices in a weighted graph?

Q5) If we are given the adjacency matrix of a weighted (undirected)graph,how can we use it to determine the number of edges in the graph?

Q6) Suppose we have a weighted graph with n vertices,and at least n edges.Explain is wrong with the following approach for finding the minimum spanning tree: while(the number of edges in the graph >= n) find the edge with the highest weight and delete it from the graph

Page 17

To view all questions and flashcards with answers, click on the resource link above.

Chapter 15: External Methods

Available Study Resources on Quizplus for this Chatper

30 Verified Questions

30 Flashcards

Source URL: https://quizplus.com/quiz/51590

Sample Questions

Q1) In a B-tree,all leaves must be at the same level.

A)True

B)False

Q2) A file is typically partitioned into individual ______ which are the smallest unit of transfer between internal and external memory.

A)blocks

B)disks

C)keys

D)lines

Q3) What is the advantage of using a B-tree instead of a 2-3 tree for indexing external data?

Q4) Why is random access preferable over sequential access for supporting external tables?

Q5) Inserting a single key value into a B-tree can result in more than one node splitting operation.

A)True

B)False

Q6) What is the maximum number of nodes in a B tree of height 3 and degree 10?

Q7) Name two advantages to storing a data structure in external storage.

Page 18

To view all questions and flashcards with answers, click on the resource link above.

Turn static files into dynamic content formats.

Create a flipbook
Advanced Programming with Java Exam Materials - 870 Verified Questions by Quizplus - Issuu