Can you create an alias in Java. If so, how?
Last edited by Darkwraith; Aug 9th, 2004 at 07:30 AM.
"Can't" and "shouldn't" are two totally separate things. All questions should be answered. All answers should be true. That is why I post.
Yes. Since all an alias is, is a reference that denotes the same object as another reference. Code: X x = new X(); Y y = new Y(); boolean alias = x == y; // false x = y; boolean aliases = x == y // true, denote the same object
X x = new X(); Y y = new Y(); boolean alias = x == y; // false x = y; boolean aliases = x == y // true, denote the same object
Java CodeBank Entries >> Parsing URL's| Collections/ShuffleElements | Threads isAlive() | Daemon Threads |Remote Class Loading | Sorted Keys (Map) | Backwards List | Thread States | Collections/Arrays Generics | Regular Expression(Grouping and Capturing) | Properties | JLabel/JTextField Combo | Reading Request Parameter Values | Host Lookup | Setting the size of a JFrames inner-region | GUI Native L&F
Thank you.
Forum Rules