Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2005

Tip: Looking for answers? Try searching our database.

java Array objects

Thread view: 
ickz - 20 Feb 2005 12:09 GMT
Hi all,
I am not new to java, but I'm quite confused by this problem I've been
given. I have to create a function of this type:
public boolean checkInfo(Array info);

However, I have never used type 'Array' before and haven't yet found
info to help create an object of that type (only the ability to use
java.lang.reflect.Array functions on array types). Array objects I've
come across before are things like int[], char[], float[] and so forth,
not actual 'Array' objects. How do I use this type?

Thanks for any help,
~ickz~
Stefan Schulz - 20 Feb 2005 12:52 GMT
> Hi all,
> I am not new to java, but I'm quite confused by this problem I've been
[quoted text clipped - 6 lines]
> come across before are things like int[], char[], float[] and so forth,
> not actual 'Array' objects. How do I use this type?

There is no "common ancestor" to all Arrays except Object. The best you
could do would be to overload the function to accept all primitive arrays
(int [], long[], short[], byte[], char[], float[], double[] and
Object[]), this way enabling all array types to be passed. However, are
you sure you understood your assignment correctly? It looks like an
ulikely job.

Signature

In pioneer days they used oxen for heavy pulling, and when one ox
couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
be trying for bigger computers, but for more systems of computers.
          --- Rear Admiral Grace Murray Hopper

Hal Rosser - 20 Feb 2005 21:15 GMT
> Hi all,
> I am not new to java, but I'm quite confused by this problem I've been
[quoted text clipped - 9 lines]
> Thanks for any help,
> ~ickz~

This could be interesting. The Array class is final.
I would clarify the assignment with the Instructor/ or boss.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.