TL; DR: No, this is not so good, but you can be guided by the compiler.
And it's easy to check (I entered the code in test.scala):
scalac test.scala
javap Foo.class
, val , . -:
javap -c Foo.class
Compiled from "test.scala"
public class Foo {
public int BUFFER_SIZE();
Code:
0: aload_0
1: getfield #15 // Field BUFFER_SIZE:I
4: ireturn
, getfield, , ( getstatic, ).
public final int BUFFER_SIZE();
Code:
0: sipush 1024
3: ireturn
, BUFFER_SIZE final:
class Foo {
final val BUFFER_SIZE = 1024
val buffer = new Array[Byte](BUFFER_SIZE)
}
private[this], @ghik, . , final , private[this] .