Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

interview questions  RSS feed

 
Ranch Hand
Posts: 397
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would appreciate if some one could answer the following questions:

How to calculate the maximum amount of memory that can be allocated to a program?

Different between Array and ArrayList?

How to avoid memory leaks?

Write a program to find the number of times a number is repeated ? eg: {1,2,3,1,1,3}

should return 1 repeated 3 times
2 once and 3 twice. What type of data structure can be used in this scenario?

Thanks in advance.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do read Some stuff. go thorough documentation for Java .. you would get answer to all these questions..search in google..

No fun in getting answers readymade. right?
 
Ayub ali khan
Ranch Hand
Posts: 397
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anupam. I will do that
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Different between Array and ArrayList?

Is that:
1. "array"
2. java.lang.reflect.Array
3. java.sql.Array
4. java.util.Arrays
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q)How to calculate the maximum amount of memory that can be allocated to a program?

java -Xms32m -Xmx128m MyProgram

where 32m is minimum and 128m is maximum

Q)Different between Array and ArrayList

Ans. The ArrayList is a resizeable arrays. In arrays you cannot change the length of arrays once declared.

Q)How to avoid memory leaks

Memory leaks occur due to incomplete deallocation of memory. It could be avoided by deallocating the object references as soon as possible in a program.
 
Ayub ali khan
Ranch Hand
Posts: 397
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Praveena and all others who have answered.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!