Reputation: 19589
I want show the content of my java object in eclipse console, just like debugging in chrome, and show JavaScript object in chrome console use the console.dir();
Upvotes: 2
Views: 1284
Reputation: 122006
Just Ovveride the toString()
method of your Object and construct your String there in whichever format you like, For ex
@Override
public String toString() {
return "Objname{" + "property1=" + value1+ ",
prop2=" + val2+ ",
prop3=" + val3+ '}';
}
then simply
System.out.println(object.toString());
Upvotes: 1
Reputation: 393966
Run your code with a debugger, and watch whatever object you need to.
Upvotes: 1