Default Values
Just like regular fields in classes, global fields will initialize to their default value unless explicitly initialized.
int x;
int y = 5;
void main() {
System.out.println(x);
System.out.println(y);
}
Just like regular fields in classes, global fields will initialize to their default value unless explicitly initialized.
int x;
int y = 5;
void main() {
System.out.println(x);
System.out.println(y);
}