Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
February 15, 2002
This question seems easy, but nonetheless I have no idea how to do it. I have a byte array: a[100]. Is there a simple way to copy only from a[0] to byte a[50]? (I don't want to use a for/while loop.)
You're correct, the answer is really simple. The problem is that the answer lies in one of those classes everyone seems to
overlook: java.lang.System. System includes the following method that does what you need:
public static void arraycopy(Object src,
int src_position,
Object dst,
int dst_position,
int length)
So, to copy your array, try the following:
byte [] dst = new byte[50]; System.arraycopy( a, 0, dst, 0, 50 );
Java developers also overlook the java.util.Arrays class. While Arrays won't help you with your copy problem, it will help you sort and fill your arrays.
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq