File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Cattle Drive and the fly likes Instantiating Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Reply Bookmark "Instantiating Objects" Watch "Instantiating Objects" New topic
Author

Instantiating Objects

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
In Sun's tutorials they state:

You can create a Rectangle object with Rectangle rec = new Rectangle(10,10), and then later do something like rec.origin.x and get a value returned. If when you use the new Point(0,0), you no longer are able to access that reference, how does the origin object in rec know where to go? I have used these types of statements several times, but coming across Sun's statement that you lose the ability to access this reference after the statement is done executing through me for a loop (and not the good kind that ends cleanly).
Is it due to the fact that when you send the unassigned reference to Point p you are now giving it a variable it is associated with?
If you want to see the whole code, it's at:
http://java.sun.com/docs/books/tutorial/java/data/objects.html
Select the CreateObjectDemo, Point and Object java files.
I figure enough of you have been through this tutorial that you know precisely where and what I am talking about
Jason
[This message has been edited by jason adam (edited July 12, 2001).]

[This message has been edited by Marilyn deQueiroz (edited July 12, 2001).]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9033
    
  10
This seems to have nothing to do with the Cattle Drive assignments. I'm moving it to Jave in General (beginning)


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instantiating Objects
 
Similar Threads
Instantiating Objects
Creating a local instance of a class
Scrolling Components
Using interface as a type
Multi constructors