Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

) exam 1.pdf LTX o a file:///C/Users/becca_000/Desktopjava%20fal Vexam1.pdf Exam

ID: 3601160 • Letter: #

Question

) exam 1.pdf LTX o a file:///C/Users/becca_000/Desktopjava%20fal Vexam1.pdf Examine the code for the class that appears on page 7. Assume the code is correct, that is that it compiles and "runs". Based on this code, answer questions 2 13 If there is nothing to list, write the word "None" 2. List any fields that are declared in this class. Give the declaration (type and name). Include the line numbers where they are declared. Note: These are headers. Write your answers below the underscore.) name line number List any methods that are declared in this class. Give the method header. Include the line numbers where they are declared. 3. header line number 10:51 AM 10/25/2017 1 Type here to search

Explanation / Answer

answer 2)

type    name    line no.

cob    mug    3

pen    key 4

answer 3)

header line no.

public void candy(pen zip)    7

public bap candy(cob xyz)    15

answer 4)

header    line no.

public Candy()    20

answer 5)

type    name line no.

Object xyz 8

cob key    16

answer 6)

type    name line no.

pen zip    7

cob xyz 15

answer 7)

class/method    argument    line no.

count    zip.reset    8

value key.count(zip.reset)    8

count    mug , key.super() 16

count key    17

pen    key.reset 21

answer 8)

keyword    line no.

public    1

class    1

private 3

public    5

new 5

public    7

void 7

if    9

else 11

public 15

return 17

public    20

new 21

answer 9)

method name class line no.

value pen 8

count    pen    8

count    cob    16

count pen 17

answer 10)

field name    class line no.

reset    pen    8

reset pen 21

answer 11)

classes -    cob , pen ,object

answer 12)

overloaded method = public void candy(pen zip); , public bap candy(cob xyz);

answer 13)

cob extends object from line no. 10

pen extends cob from line no. 21