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 4 out of 44 pages
Exam (elaborations)

CSE 205 Final Updated Actual Exam Questions And Correct Answers |Graded A+|

Document preview thumbnail
Preview 4 out of 44 pages

CSE 205 Final Updated Actual Exam Questions And Correct Answers |Graded A+| Which of the following could be used to instantiate a new Student s1? a) new Student(s1); b) new Student s1 = ("Jane Doe", "Computer Science", 3.333, 33); c) Student s1 = new Student("Jane Doe", "Computer Science", 3.333, 33); d) Student s1 = new Student( ); e) s1 = new Student( ); - ANSWER -c) Student s1 = new Student("Jane Doe", "Computer Science", 3.333, 33); Consider a method defined with the header: public void foo(int a, int b). Which of the following method calls is legal? a) foo(0 / 1, 2 * 3); b) foo(0, 0.1); c) foo(0); d) foo(1 + 2, 3 * 0.1); e) foo( ); - ANSWER -a) foo(0 / 1, 2 * 3); Use the following partial class definitions: public class A1 { public int x; private int y; protected int z; ... } public class A2 extends A1 { protected int a; private int b; ... } public class A3 extends A2 { private int q; ... } Which of the following is true with respect to A1, A2 and A3? a) A2 and A3 are both subclasses of A1 b) A1 and A2 are both subclasses of A3 c) A1 is a subclass of A2 and A2 is a subclass of A3 d) A3 is a subclass of A2 and A2 is a subclass of A1 - ANSWER -d) A3 is a subclass of A2 and A2 is a subclass of A1 Use the following partial class definitions: public class A1 { public int x; private int y; protected int z; ... } public class A2 extends A1 { protected int a; private int b; ... } public class A3 extends A2 { private int q; ... } Which of the following lists of instance data are accessible in class A2? a) z, a, b b) x, y, z, a c) x, y, z, a, b d) a, b e) x, z, a, b - ANSWER -e) x, z, a, b Use the following partial class definitions: public class A1 { public int x; private int y; protected int z; ... } public class A2 extends A1 { protected int a; private int b; ... } public class A3 extends A2 { private int q; ... } Which of the following lists of instance data are accessible in A3? a) x, z, a, q b) x, y, z, a, b, q c) a, q d) x, a, q e) a, b, q - ANSWER -a) x, z, a, q

Content preview

CSE 205 Final Updated Actual Exam
Questions And Correct Answers |Graded
A+|
Which of the following could be used to instantiate a new Student s1?

a) new Student(s1);
b) new Student s1 = ("Jane Doe", "Computer Science", 3.333, 33);
c) Student s1 = new Student("Jane Doe", "Computer Science", 3.333, 33);
d) Student s1 = new Student( );
e) s1 = new Student( ); - ANSWER -c) Student s1 = new Student("Jane Doe",
"Computer Science", 3.333, 33);

Consider a method defined with the header: public void foo(int a, int b). Which of
the following method calls is legal?
a) foo(, 2 * 3);
b) foo(0, 0.1);
c) foo(0);
d) foo(1 + 2, 3 * 0.1);
e) foo( ); - ANSWER -a) foo(, 2 * 3);

Use the following partial class definitions:
public class A1
{
public int x;
private int y;
protected int z;
...
}
public class A2 extends A1
{
protected int a;

, private int b;
...
}
public class A3 extends A2
{
private int q;
...
}
Which of the following is true with respect to A1, A2 and A3?

a) A2 and A3 are both subclasses of A1
b) A1 and A2 are both subclasses of A3
c) A1 is a subclass of A2 and A2 is a subclass of A3
d) A3 is a subclass of A2 and A2 is a subclass of A1 - ANSWER -d) A3 is a
subclass of A2 and A2 is a subclass of A1

Use the following partial class definitions:
public class A1
{
public int x;
private int y;
protected int z;
...
}
public class A2 extends A1
{
protected int a;
private int b;
...
}
public class A3 extends A2
{
private int q;
...
}

,Which of the following lists of instance data are accessible in class A2?

a) z, a, b
b) x, y, z, a
c) x, y, z, a, b
d) a, b
e) x, z, a, b - ANSWER -e) x, z, a, b

Use the following partial class definitions:
public class A1
{
public int x;
private int y;
protected int z;
...
}
public class A2 extends A1
{
protected int a;
private int b;
...
}
public class A3 extends A2
{
private int q;
...
}
Which of the following lists of instance data are accessible in A3?

a) x, z, a, q
b) x, y, z, a, b, q
c) a, q
d) x, a, q
e) a, b, q - ANSWER -a) x, z, a, q

, Use the following partial class definitions:
public class A1
{
public int x;
private int y;
protected int z;
...
}
public class A2 extends A1
{
protected int a;
private int b;
...
}
public class A3 extends A2
{
private int q;
...
}
Which of the following is true regarding the use of instance data y of class A1?

a) it is accessible in A1 and A2
b) it is accessible in A1, A2 and A3
c) it is accessible only in A3
d) it is accessible only in A1
e) it is not accessible to any of the three classes - ANSWER -d) it is accessible
only in A1

All classes in Java are directly or indirectly subclasses of the _______ class.

a) Object
b) this
c) Reference
d) String
e) Wrapper - ANSWER -a) Object

Document information

Uploaded on
May 2, 2026
Number of pages
44
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
£12.45

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.
TheExamMaestro
3.6
(18)
Sold
151
Followers
5
Items
3643
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 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