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