[5258] in java-interest
Thanks for replies
daemon@ATHENA.MIT.EDU (kkobashi@ix13.ix.netcom.com)
Sun Feb 4 06:28:01 1996
From: kkobashi@ix13.ix.netcom.com
Date: Sun, 4 Feb 1996 02:20:33 -0800
To: java-interest@java.Eng.Sun.COM
Thanks to all who replied to my question about the
'new' keyword in Java. Terrific responses by all.
Many people have pointed out a useful analogy between
C++ and Java in variable and instance syntax.
This is depicted below:
C++ Java
---- ----
Date *d; Date d;
Date d = new Date; Date d = new Date;
I am assuming that there exists a large memory pool allocated by the
Java interpreter memory manager and that this memory exists
in the system memory heap. It consists of two entities - "handles"
and the objects themselves.
Given that description, can I safely assume:
- Java does not allow pointer manipulation and uses "handles" as a safe,
protected
means to access instances
- Variables and instances are not the same thing...
- Variables are handles that contain null references
- Instances are handles that contain a pointer within the object memory
pool store
- One must use 'new' to create an instance
- Q: How are the standard data types (float, int, etc) treated in java? As
instances
that exist within the memory pool? System heap?
- Q: Since everything in Java appears to be a class, is it safe to assume that
the handles (of Java class instances) represent class methods, class
info and a pointer
to the instance within the memory pool?
- Q: When are the benefits of using the Integer, Float, Double, etc. classes
as opposed
to the standard types?
- Q: What determines an instances "marked for deletion bit"? Reference count
going to zero?
Thanks
kerry
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com