Skip to content

Instantly share code, notes, and snippets.

@SaBenBurra
Created October 10, 2022 13:47
Show Gist options
  • Save SaBenBurra/4b903cfa23d44ce7b930c48eca4119ea to your computer and use it in GitHub Desktop.
Save SaBenBurra/4b903cfa23d44ce7b930c48eca4119ea to your computer and use it in GitHub Desktop.
public class Main {
public void main(String[] args) {
SampleClass myObject1 = new SampleClass(5);
SampleClass myObject2 = myObject1;
myObject2.number = 20;
System.out.println(myObject1.number);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment