Class Notes (836,414)
Canada (509,777)
York University (35,328)
ITEC 1620 (35)
Lecture

ReferencesTutorialSolution.pdf

4 Pages
132 Views
Unlock Document

Department
Information Technology
Course
ITEC 1620
Professor
Stephen Chen
Semester
Fall

Description
References: Sample 1: The file OneInt.java contains the following implementation of the OneInt class: public class OneInt { public int value; public OneInt (int value) } The file TwoInts.java contains the following implementation of the TwoInts class: public class TwoInts { public int int1; public OneInt int2; public TwoInts (int int1, OneInt int2) } The main method in the file MainClass.java uses the above classes: public class MainClass { public static void main(String[] args) { OneInt x = new OneInt(5); OneInt y = new OneInt(7); TwoInts a = new TwoInts(x.value, x); // Part 1 – draw the object diagrams at this time x.va=ue x = new OneInt(8); a.i=t1lue; a.inyt2; a.int2 = new OneInt(9); // Part 2 – draw the object diagrams at this time } } When java MainClass is executed, Part 1: draw the object diag rams for all identifiers of OneInt and TwoInts when the comment line “ // Part 1 – draw the object diagrams at this time” is reached. a OneInt x value 5 TwoInts int1 5 int2 OneInt y value 7 Part 2: draw the object diag rams for all identifiers of OneInt and TwoInts when the comment line “ // Part 2 – draw the object diagrams at this time” is reached. OneInt x value 8 OneInt y value 3 a TwoInts OneInt int1 7 value 9 int2 Sample 2: The file AnInt.java contains the fo
More Less

Related notes for ITEC 1620

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit