2
I created a class ponto2d
with the x and y attributes, I created the get and set methods, until ai blz, then created a class retângulo
with width and height, I need to know the value of a point in two-dimensional Cartesian space.
2
I created a class ponto2d
with the x and y attributes, I created the get and set methods, until ai blz, then created a class retângulo
with width and height, I need to know the value of a point in two-dimensional Cartesian space.
1
From what I understand, your own class is a POJO, that is, it is a class that we use to carry data from one method to another, and instead of spending all the time X and Y, passing only its class ponto2d
as a parameter.
A good basis is class Point2d of the JDK itself: it itself represents a point and is used as the basis value for a Cartesian point by other geometry classes.
That is, if you have a triangle, you will have 3 objects point2d to represent the Cartesian points.
Browser other questions tagged java
You are not signed in. Login or sign up in order to post.
Prefer to copy and paste the code. It is much more readable. Also, the question was not very clear. Can you explain better? (editing the post)
– Guilherme Bernal
What you call the "point value" for the purpose of this question?
– Bacco