I gather you are looking at this and thinking it is a chicken and the egg type issue, but it's not at all.
If this is your first OO language you are probably confused about Java's terminology. Java has something called "static methods". You're main(String[]) method is a static method. These static methods are really just plain old functions. Object Oriented methods on the other hand are called "instance methods" or just "methods". People are often sloppy about the terminology.
In Java, a function (i.e. static method) must be defined in the same place as a class and uses that classes' name identify it. But, it is still just a plain old function. Sometimes a class just has nothing but a bunch of loosely related functions/static methods. Like the Math class has a bunch of functions about math. Sometime a more OO class like string will have some static methods/functions thrown in with the OO methods.
In your program your main function has nothing to do with your class. But it's still perfectly fine to put it there for a small example.
When Java starts in ALWAYS starts in a main function somewhere (you can tell it what class the main function is in).
So when your program runs the JVM selects your main function as a valid main function. It runs the function. Its just a function it doesn't need any objects. Calling main does not create any objects.
Now, when your are in main(String[]) you happen to create an Object here:
XCopy x = new XCopy();
Now you have a new object of type XCopy pointed to by the reference (object pointer) x in the local scope of the main function. If XCopy had a constructor it would have been called.
So if you want to picture it in your head let me write it in a fictitious language for you that has a clear more visual syntax!
here it is:
Namespace XCopy
{
function void main(String[])
{
int orig = 42;
XCopy x = new XCopy();
int y = x.go(orig);
System.out.println(orig + " " + " y);
}
}
Class XCopy
{
method int go(int i)
{
....
return whatever;
}
}
In this same program in this other languages' syntax you can see that you have one function, one class with one method, and you have one instance of that class.
Hope that helps!!