Q:

Creating objects in Java

This is the code
public class CreateObjectDemo {
    public static void main(String[] args){
        Point    originOne     = new Point(23,94)

        rectTwo.origin = originOne;

        System.out.println("X postion of rectTwo: " + rectTwo.origin.x);
        System.out.println("Y Position of rectTwo: " + rectTwo.origin.y);

        rectTwo.move(40, 72);
        System.out.println("X position of rectTwo : " + rectTwo.origin.x);
        System.out.println("Y position of rectTwo : " + rectTwo.origin.y);
    }
}`

I have this code from Java tutorial, but I have trouble running it, it shows error of "Point" and "Rectangle" , error said "Point" & "Rectangle" can nont resolve into a type.  What am I missing here ?  
I am beginner in Java, so I am very silly . 

A:

It looks like the tutorial you are using is from the following link:
http://www.java2s.com/Code/Java/Class/CreateObjectDemo.htm
The code in the tutorial works.  It seems you didn't copy the "Point" and "Rectangle" classes into your file.  This is what you need to do:

Copy the entire tutorial code into a file named "CreateObjectDemo.java"
run "javac CreateObjectDemo.java" on the command line
run "java CreateObjectDemo" on the command line

Width of rect_one: 100
Height of rect_one: 200
Area of rect_one: 20000
X Position of rect_two: 23
Y Position of rect_two: 94
X Position of rect_two: 40
Y Position of rect_two: 72

