Beginning Java Programming Exam Solutions - 620 Verified Questions

Page 1


Beginning Java Programming Exam Solutions

Course Introduction

Beginning Java Programming introduces students to the fundamental concepts and skills required to develop applications using the Java programming language. The course covers essential topics such as data types, variables, operators, control structures, arrays, methods, and object-oriented programming principles including classes and objects. Students will also learn to work with basic input/output operations and simple graphical user interfaces. Through hands-on exercises and projects, participants gain practical experience in writing, testing, and debugging Java programs, building a solid foundation for further study in programming and software development.

Recommended Textbook

Starting Out with Java Early Objects 5th Edition by Tony Gaddis

Available Study Resources on Quizplus

16 Chapters

620 Verified Questions

620 Flashcards

Source URL: https://quizplus.com/study-set/1061

Page 2

Chapter 1: Introduction to Computers and Java

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) Application software refers to

A) the programs that make the computer useful to the user.

B) the operating system.

C) key words.

D) pseudocode.

Answer: A

Q2) A runtime error is usually the result of

A) a logical error.

B) a syntax error.

C) a compilation error.

D) bad data.

Answer: A

Q3) A characteristic of ________ is that only an object's methods are able to directly access and make the changes to the object's data.

A) classes

B) procedures

C) data hiding

D) component reusability

Answer: C

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

Page 3

Chapter 2: Java Fundamentals

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) This is a value that is written into the code of a program.

A) Literal

B) Assignment statement

C) Operator

D) Variable

Answer: A

Q2) A(n) ________ is a dialog box that prompts the user for input.

A) input box

B) user prompt

C) adaptive dialog

D) input dialog

Answer: D

Q3) What is the result of the following expression?

10 + 5 * 3 - 20

A) -5

B) -50

C) 5

D) 25

Answer: C

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

Page 4

Chapter 3: A First Look at Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A group of related classes is called a(n)

A) archive.

B) package.

C) collection.

D) attachment.

Answer: B

Q2) The scope of a local variable is

A) inside the parentheses of a method header.

B) the method in which they are defined.

C) inside the class, but not inside any method.

D) the entire class.

Answer: B

Q3) When an argument is passed by value,

A) the parameter variable holds the address of the argument.

B) the parameter variable cannot be changed.

C) the parameter variable holds a copy of the value passed to it.

D) changes can be made to the argument variable.

Answer: A

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

5

Chapter 4: Decision Structures

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) What would be the value of discountRate after the following statements are executed?

Double discountRate; Char custType = 'B'; Switch (custType) { Case 'A':

DiscountRate = 0.08; Break; Case 'B':

DiscountRate = 0.06; Case 'C':

DiscountRate = 0.04; Default:

DiscountRate = 0.0; }

A) 0.08

B) 0.06

C) 0.04

D) 0.0

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

Page 6

Chapter 5: Loops and Files

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A ________ is a value that signals when the end of a list of values has been reached.

A) terminal

B) sentinel

C) token

D) delimiter

Q2) The for loop is a posttest loop that has built-in expressions for initializing, testing, and updating.

A)True

B)False

Q3) In a for loop, the control variable can only be incremented.

A)True

B)False

Q4) In general, there are two types of files:

A) text and binary.

B) encrypted and unencrypted.

C) delimited and unlimited.

D) static and dynamic.

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

Page 7

Chapter 6: A Second Look at Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If you have defined a class SavingsAccount with a public static method getNumberOfAccounts, and created a SavingsAccount object referenced by the variable account20, which of the following will call the getNumberOfAccounts method?

A) account20.getNumberOfAccounts();

B) SavingsAccount.getNumberOfAccounts();

C) getNumberOfAccounts();

D) None of the above

Q2) A static field is created by placing the key word static

A) after the access specifier and field's data type.

B) after the access specifier and before the field's data type.

C) after the field name.

D) in brackets, before the field's data type.

Q3) The JVM periodically performs this process to remove unreferenced objects from memory.

A) memory shuffling

B) system restore

C) garbage collection

D) memory sweeping

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

Chapter 7: Arrays and the ArrayList Class

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If numbers is a two-dimensional array, which of the following would give the number of columns in row r?

A) numbers.length

B) numbers.length[r]

C) numbers[r].length

D) numbers[r].length[r]

Q2) A partially filled array is normally used

A) when a very small number of values need to be stored.

B) when you know how many elements will be in the array.

C) with an accompanying parallel array.

D) with an accompanying integer value that holds the number of items stored in the array.

Q3) Given the following two-dimensional array declaration, which statement is true?

Int[][] numbers = new int[6][9];

A) The numbers array has 54 rows.

B) The numbers array has 15 rows.

C) The numbers array has 6 rows and 9 columns.

D) The numbers array has 6 columns and 9 rows.

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

9

Chapter 8: Text Processing and Wrapper Classes

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) What will be the value of position after the following code is executed? Int position;

String str = "The cow jumped over the moon."; Position = str.indexOf("ov");

A) 14

B) 15

C) 18

D) 17

Q2) StringBuilder objects are not immutable.

A)True

B)False

Q3) You will cause an off-by-one error, when working with a character position within a string, if you think of the first position in a string as 1.

A)True

B)False

Q4) Most of the String comparison methods are case sensitive.

A)True

B)False

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

Page 10

Chapter 9: Inheritance

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If ClassC is derived from ClassB, which is derived from ClassA, this would be an example of

A) a chain of inheritance.

B) linear inheritance.

C) multiple interfaces.

D) cascading classes.

Q2) A ________ member's access is somewhere between private and public. A) package

B) final

C) protected

D) static

Q3) A protected member of a class may be directly accessed by A) methods of the same class.

B) methods of a subclass.

C) methods in the same package.

D) All of the above

Q4) You show inheritance in a UML diagram by connecting two classes with a line that has an open arrowhead that points to the subclass.

A)True

B)False

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

Chapter 10: Exceptions and Advanced File I/O

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) When an exception is thrown by code in the try block, the JVM begins searching the try statement for a catch clause that can handle it and passes control of the program to A) the last catch clause that can handle the exception.

B) each catch clause that can handle the exception.

C) the first catch clause that can handle the exception.

D) the statement that appears immediately after the catch block.

Q2) Beginning in Java 7, you can use ________ to reduce a lot of duplicated code in a try statement that needs to catch multiple exceptions, but perform the same operation for each one.

A) multi-catch

B) catch templates

C) multi-try

D) catchAll

Q3) The RandomAccessFile class treats a file as a stream of A) bytes.

B) characters.

C) integers.

D) data.

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

12

Chapter 11: GUI Applications Part 1

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) Splash screens are particularly important for large applications that take a long time to load, because they assure the user that the program is not malfunctioning.

A)True

B)False

Q2) Very few of the Swing components are coupled with peers, so they are called ________ components.

A) peerless

B) fixed

C) singular

D) lightweight

Q3) A modal dialog box

A) suspends execution of any other statements until the dialog box is closed.

B) is displayed for a short period of time and then disappears from the screen.

C) always appears in the center of the screen.

D) determines the mode your program runs in.

Q4) By default, a window is hidden from view when the close button is clicked, but the application is not terminated.

A)True B)False

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

Chapter 12: GUI Applications Part 2

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If you call the JTextField component's setEditable method and pass false as the argument, then the text field becomes

A) unbound.

B) editable.

C) invisible.

D) read-only.

Q2) You can create a label with an image or text, but you cannot create a label with both an image and text.

A)True

B)False

Q3) Which of the following file types is not supported by the ImageIcon class?

A) JPEG

B) GIF

C) BMP

D) PNG

Q4) After you create a menu item, you must add it to a JMenu component in order for it to be displayed on the menu.

A)True

B)False

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

Chapter 13: Applets and More

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) An application can use this object to execute code automatically at regular time intervals.

A) Clock

B) Regulator

C) Meter

D) Timer

Q2) Web pages are normally written in

A) Hypertext Markup Language (HTML).

B) Extensible Markup Language (XML).

C) Standard Generalized Markup Language (SGML).

D) Generalized Markup Language (GML).

Q3) These are Java programs that are usually part of a Web site.

A) classes

B) applications

C) applets

D) Web services

Q4) An applet does not have to be on a Web server in order to be executed.

A)True

B)False

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

Chapter 14: Creating GUI Applications with JavaFX

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) In the controller class, you can use the CheckBox's ________ method to determine whether the CheckBox is selected or not.

A) getIndex

B) isActive

C) isChecked

D) isSelected

Q2) Even if a variable will not reference a component in the GUI, it is necessary to precede the declaration by the @FMXL annotation.

A)True

B)False

Q3) Which of the following does not belong in a JavaFX scene graph?

A) trunk node

B) branch node

C) leaf node

D) root node

Q4) In a scene graph, the root node and branch nodes can have children, but leaf nodes cannot.

A)True

B)False

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

Chapter 15: Recursion

Available Study Resources on Quizplus for this Chatper

20 Verified Questions

20 Flashcards

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

Sample Questions

Q1) The ________ is at least one case in which a problem can be solved without recursion.

A) recursive case

B) base case

C) termination point

D) point of absolution

Q2) A method that calls itself is a ________ method.

A) recursive

B) redundant

C) binary

D) derived

Q3) The recursive binary search algorithm is a good example of repeatedly breaking a problem down into smaller pieces until it is solved.

A)True

B)False

Q4) A problem can be solved recursively if it can be broken down into successive smaller problems that are identical to the overall problem.

A)True

B)False

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

Chapter 16: Databases

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) In SQL, the equal to operator is ==, which is the same as Java.

A)True

B)False

Q2) What term refers to data that describes other data?

A) Pseudo-data

B) Micro data

C) Abstract data

D) Meta data

Q3) In an entity relationship diagram, the primary keys are denoted with A) (PK).

B) (1).

C) (KEY).

D) (PRIME).

Q4) The term commit refers to undoing changes to a database.

A)True

B)False

Q5) SQL statements that are stored in the DBMS are called resident queries.

A)True

B)False

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

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Beginning Java Programming Exam Solutions - 620 Verified Questions by Quizplus - Issuu