Skip to main content

Application Development with Java Review Questions - 758 Verified Questions

Page 1


Application Development with Java Review Questions

Course Introduction

This course provides a comprehensive introduction to application development using the Java programming language. Students will explore object-oriented programming concepts, fundamental Java syntax, and best practices for code organization. The curriculum covers topics such as data structures, exception handling, graphical user interfaces, multithreading, and database connectivity using JDBC. Through hands-on projects and assignments, learners will gain practical experience in designing, coding, testing, and deploying Java-based applications in a range of environments. By the end of the course, students will be equipped with the skills necessary to build robust and interactive software solutions using Java.

Recommended Textbook

Absolute Java 5th Edition by Walter Savitch

Available Study Resources on Quizplus

20 Chapters

758 Verified Questions

758 Flashcards

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

Chapter 1: Getting Started

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

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

Sample Questions

Q1) What is byte-code? What is its importance?

Answer: Byte-code is the object code the Java compiler creates.Byte-code executes on the Java Virtual Machine (JVM).The JVM is platform independent,that is,not tied to one particular computer.The JVM is a fictitious computer,common to all computers; this feature makes Java unique in that the program can be created on one platform and executed on any other platform.

Q2) Why is using named constants a good programming practice?

Answer: Using named constants is a good programming practice because it is less prone to the introduction of bugs into the source code.A retail program that calculates customer purchases needs to include sales tax on the amount of purchase.The sales tax percentage seldom changes,therefore using a named constant whose value is set once reduces the risk of the programmer mistyping the percentage,which would in turn introduce a logic error,the hardest error to track.

Q3) Applets were designed to run as stand-alone applications.

A)True

B)False

Answer: False

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

Page 3

Chapter 2: Console Input and Output

Available Study Resources on Quizplus for this Chatper

29 Verified Questions

29 Flashcards

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

Sample Questions

Q1) The Java method printf is based on the ________ language.

A)Pascal

B)C++

C)C

D)ADA

Answer: C

Q2) Why is echoing user input a good programming practice?

Answer: Echoing input is a technique that is commonly used to allow the user to check their input for accuracy before it is actually sent to the program for processing.This technique reduces the chances of errors in the program.

Q3) What is whitespace and why is it import when reading input from the keyboard using the Scanner class?

Answer: Whitespace is any string of characters,such as blank spaces,tabs,and line breaks,that prints as whitespace when written on (white)paper.Whitespace servers as delimiters for many of the Scanner class methods.

Q4) Write ONE Java statement to display your first and last name on two separate lines. Answer: System.out.print("Wally\nWonders");

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

Page 4

Chapter 3: Flow of Control

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

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

Sample Questions

Q1) A compound statement is enclosed between:

A)[ ]

B){ }

C)( )

D)< >

Answer: B

Q2) When using a compound Boolean expression joined by an && (AND)in an if statement:

A)Both expressions must evaluate to true for the statement to execute.

B)The first expression must evaluate to true and the second expression must evaluate to false for the statement to execute.

C)The first expression must evaluate to false and the second expression must evaluate to true for the statement to execute.

D)Both expressions must evaluate to false for the statement to execute.

Answer: A

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

Chapter 4: Defining Classes I

Available Study Resources on Quizplus for this Chatper

44 Verified Questions

44 Flashcards

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

Sample Questions

Q1) Create a class named Appointment that contains instance variables startTime,endTime,dayOfWeek (valid values are Sunday through Saturday),and a date which consists of a month,day and year.All times should be in military time,therefore it is appropriate to use integers to represent the time.Create the appropriate accessor and mutator methods.

Q2) The parameter this refers to

A)instance variables

B)local variables

C)global variables

D)the calling object

Q3) When you give a command to run a Java program,the runtime system invokes the class constructor.

A)True

B)False

Q4) A set method is:

A)an accessor method

B)a mutator method

C)a recursive method

D)none of the above

Q5) Write a driver program to test your Student class created in question #14.

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

Chapter 5: Defining Classes Ii

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

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

Sample Questions

Q1) The method trim of the String class trims off:

A)Leading white space

B)Trailing white space

C)Leading and trailing white space

D)Blanks

Q2) Add accessor and mutator methods to the Book class created in question #13.

Q3) Only ______ copy/copies of a static variable are available to objects of a class.

A)one

B)two

C)three

D)none of the above

Q4) When used with objects,what is the equality ( == )operator really comparing?

Q5) The program included in the Java SDK that allows a programmer to separate the class interface from the class implementation is called:

A)javac

B)java

C)javadoc

D)none of the above

Q6) What is the purpose of Java's wrapper classes?

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

Chapter 6: Arrays

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) Which of the following initializer lists correctly initializes the indexed variables of an array named myDoubles?

A)double myDoubles[double] = {0.0,1.0,1.5,2.0,2.5};

B)double myDoubles[5] = new double(0.0,1.0,1.5,2.0,2.5);

C)double[] myDoubles = {0.0,1.0,1.5,2.0,2.5};

D)array myDoubles[double] = {0.0,1.0,1.5,2.0,2.5};

Q2) An ArrayIndexOutOfBounds error is a:

A)compiler error

B)syntax error

C)logic error

D)all of the above

Q3) An array is a collection of variables all of the same type.

A)True

B)False

Q4) Declare and create a 10 x 10 multidimensional array of doubles.

Q5) Write a Java method as well as any facilitator methods needed to perform a sort on an array of whole numbers in descending order.

Q6) Write a Java statement that declares and creates an array of Strings named Breeds.Your array should be large enough to hold the names of 100 dog breeds.

Page 8

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

Chapter 7: Inheritance

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

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

Sample Questions

Q1) What is package access?

Q2) A derived class contains only public instance variables and public methods from the base class.

A)True B)False

Q3) When you define a derived class,you give only the added instance variables and the added methods as well as all the methods from the base class.

A)True

B)False

Q4) You may substitute the keyword this for super()to call a constructor of the derived class.

A)True

B)False

Q5) Explain the difference between method overloading and method overriding.

Q6) What is a "has a" relationship?

Q7) Write Java statements that compares Objects,O1 and O2,using the getClass()method.

Q8) What is an "is a" relationship? How does it apply to the world of objects?

Q9) Explain what a call to super()does in a constructor of a derived class.

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

Chapter 8: Console Input and Output

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

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

Sample Questions

Q1) Assigning an object of a derived class to a variable of a base class is called:

A)static binding

B)dynamic binding

C)upcasting

D)downcasting

Q2) Assigning an object of an ancestor class to a descendent class is called:

A)static binding

B)dynamic binding

C)upcasting

D)downcasting

Q3) Explain the difference between early and late binding.

Q4) The type of the variable naming an object determines which method names can be used in an invocation with that calling object.

A)True

B)False

Q5) Write a decision statement to determine if an object should be downcast.

Q6) Describe the limitations of the copy constructor.

Q7) Downcasting should be used only in situations where it makes sense.

A)True

B)False

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

Chapter 9: Exception Handling

Available Study Resources on Quizplus for this Chatper

45 Verified Questions

45 Flashcards

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

Sample Questions

Q1) Exception handling is an example of a programming methodology known as:

A)structured programming

B)object oriented programming

C)goto programming

D)event-driven programming

Q2) Exceptions that are subject to the catch or declare rule are called:

A)Checked exceptions

B)Unchecked exceptions

C)Fatal exceptions

D)All of the above

Q3) An exception is caught in a _________ block.

A)try

B)catch

C)finally

D)all of the above

Q4) Write a Java statement that throws a new exception with the String: Disk drive not ready.

Q5) Revise the program in number 9 above to throw a NegativeNumberException if the user enters a negative number.

Q6) List five common examples of exceptions that occur.

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

Chapter 10: File IO

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

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

Sample Questions

Q1) The stream that is automatically available to your Java code is:

A)System.out

B)System.in

C)System.err

D)all of the above

Q2) Write a Java statement to create an input stream to a file named "statistics.dat".

Q3) The scanner class has a series of methods that checks to see if there is any more well-formed input of the appropriate type.These methods are called __________ methods:

A)nextToken

B)hasNext

C)getNext

D)testNext

Q4) Files whose contents must be handled as sequences of binary digits are called:

A)text files

B)ASCII files

C)binary files

D)output files

Q5) Explain what happens when an output file is opened in Java.

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

Chapter 12: Uml and Patterns

Available Study Resources on Quizplus for this Chatper

22 Verified Questions

22 Flashcards

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

Sample Questions

Q1) Draw a UML class diagram for a class that represents a sphere.

Q2) In a UML class diagram,the sharp (#)indicates:

A)public access

B)protected access

C)private access

D)package access

Q3) In a UML class diagram,the tilde (~)indicates:

A)public access

B)protected access

C)private access

D)package access

Q4) Class diagrams must contain all class members.

A)True

B)False

Q5) A container is a class whose objects hold multiple pieces of data.

A)True

B)False

Q6) Draw a UML inheritance diagram for possible classes used to represent a bank account.

Q7) Draw a UML class diagram for a class that represents a savings account.

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

Chapter 13: Interfaces and Inner Classes

Available Study Resources on Quizplus for this Chatper

32 Verified Questions

32 Flashcards

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

Sample Questions

Q1) An interface is a type.

A)True

B)False

Q2) Any constant variables defined in an interface must be defined as:

A)public

B)private

C)protected

D)package access

Q3) What are the rules of total ordering?

Q4) A Java interface is an example of:

A)encapsulation

B)abstraction

C)polymorphism

D)all of the above

Q5) Java source code that contains a class with an inner class,when compiled,will produce a separate .class file for the inner class.

A)True

B)False

Q6) Why does Java only allow the inheritance of only one base class?

Q7) What are two advantages to using inner classes?

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

Chapter 14: Generics and the Arraylist Class

Available Study Resources on Quizplus for this Chatper

31 Verified Questions

31 Flashcards

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

Sample Questions

Q1) You can not use the set method to put an element at just any index.

A)True

B)False

Q2) Write a Java statement to create an ArrayList to hold 25 integers.

Q3) The remove(Object theElement)method of the ArrayList class returns:

A)Int

B)Double

C)Byte

D)Boolean

Q4) You can use any primitive type as the base type of an ArrayList class.

A)True

B)False

Q5) The keyword ___________ can be used to place a bound on a type parameter.

A)Implements

B)Inherits

C)Encapsulates

D)Extends

Q6) You can plug in a primitive type for a type parameter.

A)True

B)False

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

Chapter 15: Linked Data Structures

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

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

Sample Questions

Q1) In Java,you indicate the end of a linked list be setting the link instance variable of the last node in the linked list to __________.

A)0

B)-1

C)1

D)null

Q2) An iterator is any object that allows you to step through the list one item at a time. A)True B)False

Q3) What is the result of a preorder traversal of the binary search tree created in question 12 above?

Q4) following values in the given order: 7,10,5,12,1,3,9.

Q5) What is the result of a postorder traversal of the binary search tree created in question 12 above?

Q6) A linked data structure contains nodes and links. A)True B)False

Q7) Discuss the differences between a queue and a stack.

Page 16

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

Chapter 16: Collections and Iterators

Available Study Resources on Quizplus for this Chatper

44 Verified Questions

44 Flashcards

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

Sample Questions

Q1) The method ___________ can be used to determine the number of elements in an ArrayList.

A)length()

B)vectorLength()

C)size()

D)vectorSize()

Q2) What must you do before adding a primitive type to a vector?

Q3) A collection is a data structure for holding elements.

A)True

B)False

Q4) What is the purpose of the Java Iterator interface?

Q5) To change an existing element of a vector you must use the __________ method. A)add()

B)set()

C)change()

D)mutate()

Q6) Write a Java statement that changes the value of element 27 to 5.0 in the resulting vector in number 3 above.

Q7) Write a Java statement to create a vector with initial capacity of 50.

Q8) What is the difference between a vector's size and a vector's capacity?

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

Chapter 17: Swing I

Available Study Resources on Quizplus for this Chatper

37 Verified Questions

37 Flashcards

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

Sample Questions

Q1) Standard layout managers are defined in the ____________ package.

A)javax.swing

B)java.util

C)java.awt

D)java.lang

Q2) Write a Java statement to add a title to the window in the GUI created in number 1 above that says "First Window".

Q3) What is an action listener? What is an action event?

Q4) A programming style that uses a signal and response approach to programming is called:

A)Object Oriented Programming

B)Structured Programming

C)Event-driven Programming

D)Bottom-up Programming

Q5) A ____________ is the smallest unit of space on which your screen can write.

A)pixel

B)dot

C)bit

D)font

Q6) Explain the model-view-controller pattern when applied to a typical GUI.

Page 18

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

Chapter 18: Swing II

Available Study Resources on Quizplus for this Chatper

31 Verified Questions

31 Flashcards

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

Sample Questions

Q1) Any change to graphics being displayed on the screen requires a call to the method ____________ to update the graphics.

A)paint

B)repaint

C)update

D)all of the above

Q2) The Graphics class is a(n)____________ class.

A)discrete

B)concrete

C)abstract

D)none of the above

Q3) Explain the Java coordinate system for graphic objects.

Q4) Write Java statements to add the icon created in number 1 above to a label that says "Love".

Q5) A window listener must define all the method headings in the WindowListener interface,even if some are trivial implementations.

A)True

B)False

Q6) Set policies for the scroll bar created in number 3 above.

Page 19

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

Chapter 19: Java Never Ends

Available Study Resources on Quizplus for this Chatper

18 Verified Questions

18 Flashcards

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

Sample Questions

Q1) The sleep method of the Thread class requires one formal parameter that represents the number of:

A)nanoseconds

B)microseconds

C)picoseconds

D)milliseconds

Q2) Threads execute in a ___________ fashion.

A)parallel

B)serial

C)complex

D)none of the above

Q3) What method in the Thread class is responsible for pausing a thread for a specific amount of milliseconds?

A)pause()

B)sleep()

C)hang()

D)kill()

Q4) What is a JavaBean?

Q5) What are Enterprise JavaBeans?

Q6) Discuss the components of the JavaBean model.

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

Chapter 11: Recursion

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

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

Sample Questions

Q1) A recursive method is one that:

A)Returns a value

B)Initializes a set of variables

C)Returns no value

D)Invokes itself

Q2) To keep track of recursion most computer systems us a structure called a queue.

A)True

B)False

Q3) A method definition that includes a call to itself is said to be recursive.

A)True

B)False

Q4) The portion of memory in which a recursive computation is stored is called a/an:

A)stack frame

B)activation record

C)all of the above

D)none of the above

Q5) What are the criteria you must consider when formulating a recursive solution?

Q6) Binary search is a divide and conquer algorithm.

A)True

B)False

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

Chapter 20: Applets

Available Study Resources on Quizplus for this Chatper

25 Verified Questions

25 Flashcards

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

Sample Questions

Q1) HTML is case sensitive.

A)True

B)False

Q2) Create an HTML block that will display "Absolute Java" in the largest standard heading.

Q3) URL stands for:

A)Unified Resource Locator

B)Uniform Reader Locator

C)Uniform Resource Locator

D)Uniform Resource Language

Q4) When you place an applet in an HTML document,you give the name of the _____________ file for the applet.

A).java

B).class

C)both A & B

D)none of the above

Q5) The terms HTML document and HTML page mean the same thing.

A)True

B)False

Q6) Write an HTML comment containing the phrase "This is a comment."

Page 22

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

Turn static files into dynamic content formats.

Create a flipbook
Application Development with Java Review Questions - 758 Verified Questions by Quizplus - Issuu