Size of class in Android Development


#1

I define a constant class, and the compiler automatically inserts a piece of code to instantiate the object, which makes the class much larger than the class defined in Java.

Is there any way to cancel the automatic insertion of this code?

java class size:227 bytes
38

kotlin class size:1 kb


#2

Keyword object implies you want to create an object, so probably not.