How to make an object out of another object
Simply create a new object and pass the required arguments in the constructor. Point position= new Point((int) (Math.random()*(max – min)),(int) (Math.random() *(max – min))); Point endPosition = new Point(position.x+2, position.y+3);