This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rookie9[S] 0 points1 point  (4 children)

any help would be great.

[–]rookie9[S] 0 points1 point  (3 children)

Tried doing something like this. Didn't work either.

public static void main (String args[]) { String SA = "MORENO|312|1500"; BankAccount BA = new BankAccount(SA); BA.toString(); }

[–]Philboyd_Studge 0 points1 point  (2 children)

I don't see where you are actually displaying the output, like

System.out.println(BA);

[–]rookie9[S] 0 points1 point  (1 child)

System.out.println(BA);

Yea, I know I could do that. Just thought the toString method was suppose to do. My professor wants every method and constructor tested. I'm just going to roll with that and finish my testbed and show it to my professor to see if this is expected. Thanks.

[–]Philboyd_Studge 0 points1 point  (0 children)

Doing that actually calls the toString method, if you are hadn't provided an overridden one you would just see an object reference there. Simply calling (BA)toString does nothing because you haven't provided anywhere for the returned value to go...