Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Code Block
languagejava
titleVariable with reference
Song s2 = new Song();
// Gitt at Song har en tom konstruktør 

Fortsetter i de neste kolonnene 

Code Block
languagejava
titleAssigning reference to other variable
Song s1 = new Song("Beat it");
Song s2;

Fortsettelse 

Code Block
languagejava
titleAssigning reference to other variable 2Continued
s2 = s1; 
System.out.println(s1 == s2);
// TRUE

Fortsettelse 

Code Block
languagejava
titleAssigning reference to other variable 3Continued 2
s1 = new Song("Let it be");

...