|
-
August 24th, 1999, 01:07 AM
#1
Referencing with respect to java
How do you reference an object and then typecast the object to something else???
What i am trying to do is to pass an object to a function to be filled, ie (I need a pointer equalivant to C++) so that I can typecast a object to a byte array.
The object that I am dealing with is the PRINTER_INFO_2 class
So what i need is a method to convert an object of this type to a byte array.
Or is their an easier way of doing this kind of thing in java
Please help,
Chris
-
August 24th, 1999, 08:01 AM
#2
Re: Referencing with respect to java
Look at this code...
[javcode]
public class rnd
{
public static void main( String arg[] )
{
Object rr = new byte[] { 0,0,0 };
System.out.println( rr );
System.out.println( ((byte[])rr)[0] );
}
}
[/javacode]
It works on my machine.
- UnicMan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|