These question are collected from some sites & I feel these are interesting to be discussed here.
1. How does the Java virtual machine handle the problem of name collisions, where two different classes have the same name?
- The VM assigns a pseudo name to each class.
- Name collisions are illegal - they are treated as exceptions.
- The VM cannot distinguish between two different classes with the same name
- The VM treats different classes loaded by different class loaders as different types, even if
2. What guarantees does the Java Virtual Machine1 Specification make regarding objects that provide a finalize method?
- These objects are given priority during garbage collection.
- The finalize method is called before the object is collected
- The finalize method is called after the object is collected
- The object is collected directly after the finalize method is called.
No comments:
Post a Comment