Whether the default encoding for jvm is UTF-8 or some other? In jvm where it will be mentioned?
It's going to be locale-dependent. Different locale, different default encoding.
The default character set of the JVM is that of the system it's running on. There's no specific value for this and you shouldn't generally depend on the default encoding being any particular value.
It can be accessed at runtime via Charset.defaultCharset()
, if that's any use to you, though really you should make a point of always specifying encoding explicitly when you can do so.
Note that you can change the default encoding of the JVM using the confusingly-named property file.encoding
.
If your application is particularly sensitive to encodings (perhaps through usage of APIs implying default encodings), then you should explicitly set this on JVM startup to a consistent (known) value.