Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Created September 28, 2023 12:01
Show Gist options
  • Select an option

  • Save nherbaut/e9c49bc4597e4cb087ed48130475943d to your computer and use it in GitHub Desktop.

Select an option

Save nherbaut/e9c49bc4597e4cb087ed48130475943d to your computer and use it in GitHub Desktop.
L2.2.4 Exo classes type et for

Combien d'objets sont crées?

public class Thing {
private int a;
public Thing(int x) {
a = x;
}
public int geta() {
return a;
}
public static void main(String ...args){
Thing f = new Thing(3);
Thing g = new Thing(5);
Thing h = f;
Thing j = h;
}
}
@nherbaut
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment