Accounting Software Support Forum
May 21, 2012, 12:47:18 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: We just started the forum so please register now and take advantage of the many free promotional memberships.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Java Interview Questions & Answers  (Read 51 times)
meena
Full Member
***
Posts: 145


View Profile Email
« on: January 30, 2012, 08:58:54 PM »

Hai all,,,,


How can we write our own arraylist without using collections?

Ans:- You have to use array of Object to store the element and then provide the functionality of adding,seraching and removing the element.This is the way you can create your own arrayList without using Collections.

1. Make an array of Object holding some predefined number of objects.
2. Take a double variable indicating loadFactor.
3. if the length of the occupied array elements becomes three fourth(or the value of the loadFactor)
3.1 Create an array of Object with size double of the original array.
3.2 copy content of original array to this new array.
3.3 return the new array and delete old array


more details...
Logged
usman0092
Newbie
*
Posts: 15


View Profile Email
« Reply #1 on: February 04, 2012, 05:27:13 AM »

hmmmm - this question has nothing to do with Yahoo Answers .. maybe ask under another category

_______________
dvd player software
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Valid XHTML 1.0! Valid CSS!