0% found this document useful (0 votes)
11 views18 pages

Java Programming MCQ Study Guide

The document provides an overview of an 'Applied Programming with Java' course, which covers fundamental programming concepts using Java, including data types, control structures, and object-oriented principles. It includes 16 chapters with 620 verified questions and additional study resources such as flashcards. The course aims to prepare students for advanced coursework or careers in software development through hands-on experience and real-world projects.

Uploaded by

ov9nfddxyu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views18 pages

Java Programming MCQ Study Guide

The document provides an overview of an 'Applied Programming with Java' course, which covers fundamental programming concepts using Java, including data types, control structures, and object-oriented principles. It includes 16 chapters with 620 verified questions and additional study resources such as flashcards. The course aims to prepare students for advanced coursework or careers in software development through hands-on experience and real-world projects.

Uploaded by

ov9nfddxyu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Applied Programming with Java

MCQ PDF

[Link]
16 Chapters
620 Verified Questions
Applied Programming with Java
MCQ PDF
Cou
Applied Programming with Java introduces students to the fundamentals of

programming using the Java language, emphasizing hands-on experience in designing,

writing, and debugging applications. The course covers core programming concepts

such as data types, control structures, object-oriented principles, exception handling, file

input/output, and graphical user interfaces. Through real-world projects and practical

problem-solving, students develop proficiency in algorithm development and software

design, preparing them for advanced coursework or careers in software development

and related fields.

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: [Link]

Page 2
Chapter 1: Introduction to Computers and Java
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) Variables are
A) symbolic names made up by the programmer whose values cannot be changed.
B) operators that perform operations on one or more operands.
C) symbolic names made up by the programmer that represents locations in the
computer's RAM.
D) reserved words.
Answer: C

Q2) Which of the following is not part of the programming process?


A) design/model
B) debugging/correcting errors
C) testing
D) All the above are parts of the programming process.
Answer: D

Q3) RAM is usually


A) an input/output device.
B) a volatile type of memory, used only for temporary storage.
C) secondary storage.
D) a static type of memory, used for permanent storage.
Answer: B

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: [Link]

Sample Questions
Q1) A Java program must have at least one
A) comment.
B) [Link](); statement.
C) class definition.
D) variable declaration.
Answer: C

Q2) If you use a flag in a format specifier, you must write the flag before the field width
and the precision.
A)True
B)False
Answer: True

Q3) Which of the following is not a valid Java comment?


A) /** Comment 1 */
B) */ Comment 2 /*
C) // Comment 3
D) /* Comment 4 */
Answer: B

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: [Link]

Sample Questions
Q1) It is common practice in object-oriented programming to make all of a class's
A) fields private.
B) methods private.
C) fields public.
D) fields and methods public.
Answer: A

Q2) A UML diagram uses the ________ symbol to indicate that a member is private.
A) *
B) -
C) #
D) +
Answer: B

Q3) A constructor is a method that is automatically called when an object is created.


A)True
B)False
Answer: True

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

Page 5
Chapter 4: Decision Structures
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) Which of the following strings could be passed to the DecimalFormat constructor to
display 12.78 as 012.8?
A) "###.#"
B) "000.0"
C) "##0.0%"
D) "$#0.00"

Q2) In an if-else statement, if the boolean expression is false


A) no statements or blocks are executed.
B) the statement or block following the else is executed.
C) the first statement or block is executed.
D) all statements or blocks are executed.

Q3) In a switch statement, if two different values for the CaseExpression would result in
the same code being executed, you must have two copies of the code, one after each
CaseExpression.
A)True
B)False

Q4) When two strings are compared using the String class's compareTo method, the
comparison is case-insensitive.
A)True
B)False

To view all questions and flashcards with Page 6 click on the resource link above.
answers,
Chapter 5: Loops and Files
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) How many times will the following do-while loop be executed?
Int x = 11;
Do
{
X += 20;
} while (x > 100);
A) 0
B) 1
C) 5
D) 4

Q2) A for loop normally performs which of these steps?


A) update the control variable during each iteration
B) test the control variable by comparing it to a maximum/minimum value and
terminate when the variable reaches that value
C) initialize a control variable to a starting value
D) All of the above

Q3) You can use the PrintWriter class to open a file and write data to it.
A)True
B)False

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: [Link]

Sample Questions
Q1) ________ is the term for the relationship created by object aggregation.
A) "Has a"
B) Inner class
C) "Is a"
D) One-to-many

Q2) An instance of a class does not have to exist in order for values to be stored in a
class's static fields.
A)True
B)False

Q3) When the this variable is used to call a constructor


A) it must be the first statement in the constructor making the call.
B) it can be anywhere in the constructor making the call.
C) it must be the last statement in the constructor making the call.
D) You cannot use the this variable in a constructor call.

Q4) The names of the enum constants in an enumerated data type must be enclosed in
quotation marks.
A)True
B)False

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

Page 8
Chapter 7: Arrays and the ArrayList Class
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) This method returns a string representing all of the items stored in an ArrayList
object.
A) show
B) toString
C) print
D) getList

Q2) The following import statement is required to use the ArrayList class:
A) import [Link];
B) import [Link];
C) import [Link];
D) import [Link];

Q3) A(n) ________ is used as an index to pinpoint a specific element within an array.
A) element
B) range
C) boolean value
D) subscript

Q4) Java does not limit the number of dimensions that an array may have.
A)True
B)False

To view all questions and flashcards with answers, click on the resource link above.
Page 9
Chapter 8: Text Processing and Wrapper Classes
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) The String class's regionMatches method performs a case-insensitive comparison.
A)True
B)False

Q2) Which of the following import statements is required to use the Character wrapper
class?
A) import [Link]
B) import [Link]
C) import [Link]
D) No import statement is needed

Q3) The String class's ________ method accepts a value of any primitive data type as
its argument and returns a string representation of the value.
A) trim
B) getChar
C) toString
D) valueOf

Q4) 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

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: [Link]

Sample Questions
Q1) All fields declared in an interface
A) have protected access.
B) must be initialized in the class implementing the interface.
C) have private access.
D) are treated as final and static.

Q2) In the following statement, which is the interface?


Public class ClassA extends ClassB implements ClassC
A) ClassA
B) ClassB
C) ClassC
D) ClassA, ClassB, and ClassC

Q3) Because every class directly or indirectly inherits from the Object class, every class
inherits the Object class's members.
A)True
B)False

Q4) When a class contains an abstract method, you cannot create an instance of the
class.
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: [Link]

Sample Questions
Q1) When writing a string to a binary file or reading a string from a binary file, it is
recommended that you use
A) methods that use UTF-8 encoding.
B) the FileReader and Writer class methods.
C) the Scanner class methods.
D) the [Link] and [Link] methods.

Q2) Look at the following code:


FileInputStream fstream = new FileInputStream("[Link]"); DataInputStream inputFile =
new DataInputStream(fstream);
This code could also be written as
A) DataInputStream inputFile = new DataInputStream(new FileInputStream("[Link]"));
B) DataInputStream inputFile = new DataInputStream("[Link]");
C) FileInputStream inputFile = new FileInputStream(new DataInputStream("[Link]"));
D) FileInputStream fstream = new DataInputStream("[Link]");

Q3) The throws clause causes an exception to be thrown.


A)True
B)False

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

Page 12
Chapter 11: GUI Applications–Part 1
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) A mutually exclusive relationship is created between radio buttons only when they
are added to a ButtonGroup object.
A)True
B)False

Q2) When this argument is passed to the JFrame class's setDefaultCloseOperation


method, the application is hidden, but not closed.
A) JFrame.EXIT_ON_CLOSE
B) JFrame.HIDE_ON_CLOSE
C) JFrame.SUSPEND_ON_CLOSE
D) HIDE_ON_CLOSE

Q3) This method of the JOptionPane class is used to display a confirm dialog box.
A) showConfirmDialog
B) showConfirmationDialog
C) showConDialog
D) showCDialog

Q4) It is possible to write the main method directly into a GUI class.
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: [Link]

Sample Questions
Q1) What does the following statement do?
JTextArea textField = JTextArea(message, 25, 15);
A) It creates a text area with 25 rows and 15 columns that will initially display the text
"message."
B) It creates a text area with 25 columns and 15 rows that will initially display the text
stored in the String object referenced by message.
C) It creates a text area with 25 columns and 15 rows that will initially display the text
stored in the JTextArea object referenced by textField.
D) It creates a text area with 25 rows and 15 columns that will initially display the text
stored in the String object referenced by message.

Q2) To change an application's look and feel, you call this static method of the
UIManager class.
A) setLookAndFeel
B) getLookAndFeel
C) addLookAndFeel
D) showLookAndFeel

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: [Link]

Sample Questions
Q1) There is no static main method needed to create an instance of the applet class
because the browser creates an instance of the class automatically.
A)True
B)False

Q2) This method draws a string as a graphic.


A) displayString
B) stringDraw
C) paintString
D) drawString

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


A)True
B)False

Q4) A mouse motion listener class must implement the MouseMotionListener interface,
which is in this package.
A) [Link]
B) [Link]
C) [Link]
D) [Link]

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: [Link]

Sample Questions
Q1) FXML uses tags to organize data, in a manner similar to the way that HTML uses tags
to format text in a Web browser.
A)True
B)False

Q2) To change the image being displayed in an ImageView component as the


application is running, you pass a reference to an Image object as an argument to this
method.
A) setImage
B) replaceImage
C) showImage
D) addImage

Q3) The Application class's ________ method is the main entry point for a JavaFx
application.
A) start
B) init
C) addWindow
D) mainFX

Q4) Like RadioButtons, CheckBoxes may be selected or deselected at run time.


A)True
B)False

To view all questions and flashcards withPage 16 click on the resource link above.
answers,
Chapter 15: Recursion
Available Study Resources on Quizplus for this Chatper
20 Verified Questions
20 Flashcards
Source URL: [Link]

Sample Questions
Q1) Which of the following problems can be solved recursively?
A) greatest common denominator
B) towers of Hanoi
C) binary search
D) All of the Above

Q2) 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

Q3) Recursion is never absolutely required to solve a problem.


A)True
B)False

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


A) recursive
B) redundant
C) binary
D) derived

Q5) A recursive method can have no more than one base case.
A)True
B)False
Page 17
To view all questions and flashcards with answers, click on the resource link above.
Chapter 16: Databases
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: [Link]

Sample Questions
Q1) If you wish to sort the results of an SQL query, you can use the ________ clause.
A) SORT BY
B) ALIGN ROW
C) ORDER BY
D) ASCEND

Q2) In SQL, the equal to operator is ==, which is the same as Java.
A)True
B)False

Q3) The columns in a table are assigned SQL data types.


A)True
B)False

Q4) Which SQL statement is used to delete a table from a database?


A) REM TABLE
B) DEL TABLE
C) DROP TABLE
D) ERASE TABLE

Q5) Although SQL is a language, you don't use it to write applications.


A)True
B)False

To view all questions and flashcards withPage


answers,
18 click on the resource link above.

You might also like