Given:
What is the result?
Given:
What is the result?
When a new instance of the Student class is created, the instance variables sName and grade are assigned default values because they are not explicitly initialized. In Java, the default value for an uninitialized String is null, and the default value for an uninitialized char is the null character, which is represented as '\u0000'. This null character is typically invisible in the output, effectively displaying as an empty character. Therefore, the output of the code will be '[null:]'.
Correct answer is missing, I tested the snippet and it returns: [null:] not initialized char returns a empty char not a '-'
Correct answer A with modification to [null:]
Correct answer is A. A String variable will be null if not defined, but char is a primitive type so is will not be null, it will be and empty char