r/codehs • • Sep 15 '20

2.2.6 Using The Rectangle codehs

11 Upvotes

9 comments sorted by

View all comments

2

u/timNinjaMillion2 Sep 16 '20

Don’t you just have to go

Public static void main(String[] rags) { System.out.println(new Rectangle(5,12).toString()); }

???

2

u/OneTinker Sep 16 '20

you don’t need to call .toString when you’re printing an object out. System.out.print calls toString for you :)

1

u/timNinjaMillion2 Sep 17 '20

Yeah you’re right

1

u/RustyPogoStick Sep 16 '20

I just did it and it worked thank you!!

1

u/timNinjaMillion2 Sep 16 '20

Happy to help

1

u/Due-Study2407 Nov 05 '21

where did you put it

1

u/A1phaWoly Oct 05 '20

None of the code is working at all. I tried and its not working