big thanks for answers!!! so the polygone was created let's say in my way but there is still teacher's method (because he wanted to start off with the 2D array of endpoints), for now I don't...
Type: Posts; User: r0x
big thanks for answers!!! so the polygone was created let's say in my way but there is still teacher's method (because he wanted to start off with the 2D array of endpoints), for now I don't...
Have another question, I put the code straight away to be more clear
ArrayList<Point><Line> points = new ArrayList<Point><Line>();
Is it possible to put in the same ArrayList objects of...
Thank you very much for explications!! This forum is cool \m/
so the idea is that when I use System.out.println() this method needs toString to print the stuff ? and by default println takes Object's toString, am I right ?
// Custom toString() Method.
public String toString() {
return "X=" + x + " " + "Y=" + y;
}
ok, so I need to write my own version of toString method ? so that after in Main it could be...
the problem is that I have no idea what toString is, I heard about this but never understood :-/
can u just write how can I see the contents of points ?
public class Point {
private double x;
private double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
I got it ) thank you
ok thanks but I changed to double
so I was thinking may be an ArrayList would be a good choice so here is the code
public class Point {
private double x;
private double y;
public...
ok
public class PolygoneMain {
public static void main(String[] args) {
float[][2] endpoints = { {2.7,5.4}, {1.1,2.8}, {1.9,1.3} };
}
Hi all! My name is Dan and I'm first time here. Hope someone can help me with the task.
The exercice is from my exam and it sounds like this:
a) Define proper data structures to represent a...