Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

replacing the array implementation ?

array

  • Please log in to reply
4 replies to this topic

#1 THX

THX

    CC Lurker

  • New Member
  • Pip
  • 8 posts
  • Location:Long Beach,CA
  • Programming Language:Java, Assembly

Posted 23 October 2012 - 05:25 PM

Greeting!!

Can anyone gave me some few pointer about replacing the array implementation? thanks
  • 0

#2 VNFox

VNFox

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 648 posts
  • Programming Language:C#, PHP
  • Learning:Assembly

Posted 23 October 2012 - 05:36 PM

JAVA doesn't have pointer. You need to use List or ArrayList
  • 0

www.pickmike.com
I don't just develop software. I find solutions to your business needs.


#3 Chall

Chall

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 349 posts
  • Location:Cedar Rapids, IA
  • Programming Language:Java
  • Learning:C, Java, C++, C#, Python, JavaScript, Assembly

Posted 23 October 2012 - 07:06 PM

JAVA doesn't have pointer. You need to use List or ArrayList

Or you could make your own. Thats the beautiful thing about programming: there is no limit (usually) to what you can do. I use my own custom designed DynamicArray called CArray. But creating your own array type is a bit complex, and, in most cases, unecessary. I posted a tutorial on making a basic custom array object, you can find it here. It's not generic, and so it is limited in some aspects, but if you want, I can provide you with the source for the one I use. It's generic, and relatively good at what it does. I also created documentation for it, so when using an IDE like Eclipse, it will tell you what the methods do.

Source (You need both classes, and they need to be inside the package util):
Attached File  CArray.java   9.93KB   210 downloads
Attached File  CArrayObject.java   1.8KB   220 downloads
  • 0
Speaks fluent Java

#4 wim DC

wim DC

    Roar

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 2681 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Python

Posted 24 October 2012 - 01:08 AM

He didn't ask for pointers as in programming pointers. He probably meant it as in he wanted some directions, hints, help about replacing the array implementation.

Where Chall's solution is ok for replacing the dynamic arrays in Java (ArrayList, LinkedList, ..), you will always fall back on Java's own arrays [ ], you can't go without.
  • 0

#5 THX

THX

    CC Lurker

  • New Member
  • Pip
  • 8 posts
  • Location:Long Beach,CA
  • Programming Language:Java, Assembly

Posted 25 October 2012 - 11:30 AM

Sorry for the late reply guys! I was busy with my Data structure assignment, which was dealing with replacing Array implementation.Anyways, thanks for clarifying me.
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download