Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/chapter05/morning/EasySound.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
public class EasySound
{
private SourceDataLine line = null;
private byte[] audioBytes;
// audioBytes is declared immutable by the final keyword. In Java, class properties declared immutable can be
// assigned only once. Generally, this should be done as much as possible. Also, final declares the reference
// immutable; the property cannot be reassigned by the object it points to can be changed (does not apply to
// primitives). For more about the final keyword, read https://en.wikipedia.org/wiki/Final_(Java)#Final_variables.
private final byte[] audioBytes;
private int numBytes;

public EasySound(String fileName)
Expand Down