View Single Post
  #2  
Old January 17, 2013, 06:08 PM
chileno's Avatar
chileno chileno is offline
Diamond
 
Join Date: Feb 2009
Location: Las Vegas, USA
Posts: 7,863
Native Language: Castellano
chileno is on a distinguished road
Quote:
Originally Posted by Jessica View Post
I'm taking a java course in college, and this is the second week...and I'm already having trouble understanding. My first application is not going well. I'm hoping to get some assistance. :/ I am completely clueless.

The Application:
Write a simple class called PointChecker that will
1) Declare a variable as a Point
2) Using the constructor that has two double parameters construct a point at location 93,67
3) Using the methods getX and getY and the System.out.print and println methods output the actual values that the created point contains
4) The output the expected values (what you expect to see)
5) Then using the translate method move the x coordinate 13 to the left (negative) and the Y value 7 down (positive).
6) Output values as described in steps 3 and 4


This is completely wrong, I know, but it's what I came up with. :/
Code:
package course.jzc22.lab01;

public class PointTester {

    /**
     * @param args
     */
    public static void main(String[] args) {
            int myPoint; }
            public int X;
            public int Y;
            myPoint.X = 93;
            myPoint.Y = 67;
        public void getX (int X) {
            X = 
            System.out.println("myPoint");
    }

}
I really don't know, but shouldn't you println myPoint instead of just Point?
Reply With Quote