• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to put the parameters to this object?  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I created this line class and when I try to create Line object with parameters, I don't know how to pass the parameters properly. It has to return two points, so it should be like [(1,2),(5,12)].
I tried different things like and similar, but nothing worked.
Any ideas how to do it properly?




 
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of new Line(Point p1(1,2), Point p2(5,12)) it would be new Line(new Point(1,2), new Point(5,12)).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!