• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 65 pages
Exam (elaborations)

CS 1101 Programming 1 JAVA All Self | Questions And Answers | Updated Study Solutions

Document preview thumbnail
Preview 4 out of 65 pages

CS 1101 Programming 1 JAVA All Self | Questions And Answers | Updated Study Solutions

Content preview

CS 1101 Programming 1 JAVA All Self | Questions
And Answers | Updated Study Solutions

Student hint: Use an online compiler such as https://www.tutorialspoint.com/compile_java_online.php for testing most of the
code required output. Change class to public class.

Self Quiz 1
Question 1
Correct
Mark 1.00 out of 1.00
Question text

Which of the following should be used to compare the contents of two String objects in Java?
Select one:
a. =
b. ==
c. cmp

d. equals
e. ?
Feedback
Your answer is correct.
"=" is for assignment. "==" compares the memory locations of String objects, not their contents.
"cmp" is a command from Python, not Java. "?" Is the conditional operator. Use "s1.equals(s2)" to
compare the contents of String "s1" and "s2". See Section 2.3.3 of Eck (2014).
The correct answer is: equals
Question 2
Correct
Mark 1.00 out of 1.00
Question text

Consider the following line of Java code.
System.out.println("Hello, World!");
"System" is which of the following?




Select one:

,a. a class
b. a method (subroutine)
c. an object
d. a parameter
e. a statement
Feedback
Your answer is correct.
"System" is a built-in Java class with static member objects, like "out". See Section 2.3.1 of Eck
(2014).
The correct answer is: a class




Question 3
Correct
Mark 1.00 out of 1.00
Question text

Consider the following line of Java code.
System.out.println("Hello, World!");
The full line of code is which of the following?
Select one:
a. a class
b. a method (subroutine)
c. an object
d. a parameter

e. a statement
Feedback
Your answer is correct.
See Section 2.1 of Eck (2014).
The correct answer is: a statement
Question 4
Correct
Mark 1.00 out of 1.00
Question text

,What does a Java compiler do?
Select one:
a. Runs Java programs
b. Translates byte code in ".class" files into machine language
c. Translates source code in ".class" files into machine language

d. Translates source code in ".java" files into Java byte code in ".class" files
e. Translates source code in ".java" files into machine language
Feedback
Your answer is correct.
The correct answer is: Translates source code in ".java" files into Java byte code in ".class" files
Question 5
Incorrect
Mark 0.00 out of 1.00
Question text

Which of the following is NOT a valid identifier in Java?
Select one:
a. p

b. Public
c. public
d. public23
e. PuBlIc_tWeNtY_3
Feedback
Your answer is incorrect.
"public" is a reserved word in Java and cannot be used as an identifier. See Section 2.2 of Eck
(2014).
The correct answer is: public




Self Quiz 2
Question 1
Correct
Mark 1.00 out of 1.00
Question text

, Assume "test" is a boolean variable. Which of the following expressions is equivalent to "test
== true"?
Select one:

a. test
b. !test
c. test = true
d. test.equals(true)
Feedback
Your answer is correct.
See Section 3.3.2 of Eck (2014).
The correct answer is: test

Question 2
Correct
Mark 1.00 out of 1.00
Question text

Which of the following keywords is useful for getting out of an infinite loop?
Select one:

a. break
b. continue
c. do
d. switch
e. while
Feedback
Your answer is correct.
See Section 3.3.3 of Eck (2014).
The correct answer is: break
Question 3
Correct
Mark 1.00 out of 1.00
Question text

Which of the following keywords is useful for processing lists of menu options?

Document information

Uploaded on
June 10, 2025
Number of pages
65
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$18.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Nipsey
4.1
(377)
Sold
2132
Followers
1529
Items
15244
Last sold
1 week ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions