-
What is the output of this program?
class box_Shape
{
int width;
int height;
int length;
}
public class mainclass
{
public static void main(String args[])
{
box_Shape obj = new box_Shape();
System.out.println(obj);
}
}
-
- Compiletime error
- Runtime error
- Garbage value
- box_Shape@2a139a55
- None of these
Correct Option: D
When we print object internally toString() will be called to return string into this format classname@hashcode in hexadecimal form.
Output: box_Shape@2a139a55