Presentation is loading. Please wait.

Presentation is loading. Please wait.

References and Objects

Similar presentations


Presentation on theme: "References and Objects"— Presentation transcript:

1 References and Objects
Data Structures

2 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }

3 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; bah(a,b); System.out.println(a.value + ", " + b.value + ", " + c.value);} }

4 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }

5 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }

6 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }

7 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }

8 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }

9 public class Y { public int value;
public static void main(String args[]) { Y a = new Y(); a.value = 1; Y b = new Y(); b.value = 10; Y c = a; c.value = 5; System.out.println(a.value + ", " + b.value + ", " + c.value);} }


Download ppt "References and Objects"

Similar presentations


Ads by Google