Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 16 pages
Exam (elaborations)

IS 5103 Quiz 1 | Questions and Answers | 2026 Update | 100% Correct - Trine University.

Document preview thumbnail
Preview 3 out of 16 pages

IS 5103 Quiz 1 | Questions and Answers | 2026 Update | 100% Correct - Trine University.

Content preview

Which statement about the following class is correct?

1 public class PoliceBox {
2 String color:
E long age
a public void PoliceBox,
5 color Lue!
5 age - 1200;
3 public static void main(String []time
var p = new PoliceBox,
L var q = new PoliceBox();
1 p.color = "green"
L p-age - 1400
g p-q
L System.out_println("Ql="+q. color.
1 System.out_println("Q2="+q.age
L System.out_println("P1="+p.color
1 System.out_println("P2="+p.age
L


A Line 12 does not compile.
8 Line 4 does not compile.
c It prints P2=1400.
[ t prints P1=null
3 It prints Q2=1200.
3 Itprints Q1=blue.
G None of these.
H Line 13 does not compile.

,Which statements about the following class are true?

1 public class River
2 int Depth = 1
s float temp - 50.0:
a public void flow
s for (int i-0
s int depth - 2
depths
temp--
10 System.out.println(depth
1 System.out.println(temp
L public static void main(String.. s
L new River().flow


Each correct answer represents a complete solution. Choose all that apply.

A The program prints 500 on fine 11.
8 The program prints 4 on line 10.
c The program prints 3 on line 10.
[ Line 10 generates 3 compiler error.
3 Line 7 generates 2 compiler error.
F Line 6 generates a compiler error.
G Line 3 generates a compiler error.
H ‘The program prints 49.0 on fine 11.

, Which of the following statements are true about this code?


var blocky
squirrel \s
pigeon \
termite
System.out.print (blocky

Each correct answer represents a complete solution. Choose all that apply.

v oA D It outputs
two lines.

8 It outputs three lines.

c it outputs four lines.
v D D There is one line with trailing whitespace.

3 There are two lines with trailing whitespace.


Which of the following expressions, when inserted independently into the blank line, allow the code to compile?

public void printHagicData
var magic = 5
System_out.println(magic):


Each correct answer represents a complete solution. Choose all that apply.



[ 5.291.2

c 3.130_

o 13290

Document information

Uploaded on
January 12, 2026
Number of pages
16
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

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.
Wiseman
3.9
(1639)
Sold
8170
Followers
3893
Items
30517
Last sold
1 hour ago



Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed 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