-
casting array of array question???
Hi all,
Here's the prob ...
public class castIt {
public static void main(String args[]) {
char ch = 5;
byte b[][] = new byte[3][3];
b[1][2] = (byte) ch;
for(int i = 0; i < 3; i++) {
System.out.println( );
for(int j = 0; j < 3; j++) {
System.out.print(" " + b[j][i]);
}
}
System.out.println();
}
}
output is:
000
000
050
required output:
000
000
0☺0
I want the smilly face (char ch = 05 ... note this is better viewed in
a
dos window some IDE's will not display these ascii characters.
Hope this makes sense... and yes I do want the array of arrays to be of type
byte.
ThanksInAdvance
Xasting.
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks