Q. What will be the output of the following Java program?
class box
{
int width;
int height;
int length;
}
class mainclass
{
public static void main(String args[])
{
box obj = new box();
System.out.println(obj);
}
}

  • (A) 0
  • (B) 1
  • (C) Runtime error
  • (D) classname@hashcode in hexadecimal form
πŸ’¬ Discuss
βœ… Correct Answer: (D) classname@hashcode in hexadecimal form

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
111
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Priyanka Tomar
Publisher
πŸ“ˆ
89%
Success Rate