drawback of arralist - java



Share on Google+Share on Google+

lokendra yadav
drawback of arralist - java
1 Answer(s)      5 years and 7 months ago
Posted in : Java Interview Questions

1.what is the maximum size of arraylist? 2.what is the drawback of arralist? 2.what is the drawback of JDBC? 4.how many access specifier and how many access modifier in java? 5.what is difference b/w abstract class and interface? 6.which is best b/w abstract class and interface?

View Answers

February 2, 2012 at 12:52 PM

1) It depend on heap size of machine and heap size depend on size of RAM. The theoretical maximum number of elements in an ArrayList is 2^31-1.

2)Inserting an element in the middle of the array list and removing an element from the middle of the array list are not efficient since the arraylist has to adjust itself to accomodate the new value. Internally it uses System.arrayCopy method which is a native method to copy the contents from old array to new array. If the array list size is very huge, Insertion and removal operations will slow down the performance of the application.

3)Drawbacks of JDBC :

a) JDBC needs database specifc queries. that means if u r using Oracle then u have to use Oracle queries, due to this reason one can't switch between the databases.

b) We can't retrive each record as object. JDBC retrives it as scalar values only. and we know objects are more faster then scalar values.

c) ResultSet is not serializable JDBC, but RowSet is serializable in jdbc. But it is not supported for all drivers.

d) Exception Handling is one of the main drawback in JDBC. eg :

                   try {
                   }catch(Exception e) {

                        try {

                         }catch(Exception e) {


           if exception raised closing connection itself , then number of times we need to write try-catch.

e) Each time connection closing is compulsory.

4)Difference between Abstract class and Interface:

a)Interfaces provide a form of multiple inheritance. A class can extend only one other class.

b)Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc.

c)A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class.

d)Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast.

6)In general, prefer interfaces if you don't need to use an abstract class, because they provide more design flexibility.


Related Tutorials/Questions & Answers:
java  What is the drawback when we use the multiple inheritance
. But to the performance point of view ArraList is better than the Vector because ArrayList
Problem with Instant Messaging - JSP-Servlet
. Please suggest how to overcome this drawback ie. how can I retrieve the message
What is IDSL?
fee. It is available on the flat rate. IDSL has one drawback that it needs own
; One of the major drawback of persistent connection is that it can be left
you tell the drawback of any existing application? if you tell means i ll try
Push and Pop operation of stack.
Description: In this tutorial of data-structure you will see push and pop operation of stack. In the previous tutorial is clearly explained the push pop operation. The drawback of implementing stack is that the size of stack
APT Editor
major drawback: you need to convert from one format (plain text) to another (ex
What is POP?
that saves the money of the consumer or company.  POP has one drawback that 
Tattoo Removal Cream
the tattoo on your body. The other drawback of using tattoo removal cream
write business as well as presentation logic is Servlet. But there is a drawback
Using Splunk with Hadoop
to Hadoop environment. One drawback is that Splunk is not able to perform
Why Open Source?
model. The drawback of the closed model is evident- its source is available only
Why WiFi?
. Drawbacks The small range is the biggest drawback for WiFi. Even while you
Rich Internet Application
the server that is required to reload the data is the biggest drawback
Rich Internet Application
drawback of this system because all interactions with the application have to pass
Dog gps tracking chip
with the ample use it provides it?s reasonable. Though there is one drawback
How jQuery works?
drawback with this function. It does not fires until all the images including
Apple's New iPad? Is It The Hottest New Release Or Simply An iFlop?
as to whether it is a bit too reflective and lacking in contrast. Another drawback
Want To Know What You Can Do Expect From Your New iPad? Look No Further?
unnoticeable. The only reported drawback of the screen is that it may lack contrast
Essentials You Need To Know About Apple's iPad
drawback of the screen that has been reported is that it may be too reflective
Hosted E-Commerce Solution
. These should many templates to choose from. The drawback of hosted solution
Career in Fashion
as well. On the other hand, the drawback is that you have very little
Personal GPS Tracking Redefined with These 4 Latest Devices
drawback is that the GPS tracker needs a coverage plan requiring to gurgle out
How would you honestly evaluate the strengths and weaknesses of your previous/current company/boss/team?
: The interviewer zeroes in on some serious drawback in your background and he brings... can prevent the drawback question from happening. 19. How comfortable are you
Top 10 Smartphones under INR 20,000
drawback that comes to mind is the little bit revamped design of the phone... drawback of this phone is its paltry internal storage which is just 4GB, though
Open Source Encryption
is being revealed to him or her (this is a known drawback in the concept of Plausible
Struts 2 Format Examples
the output as string in your action class. But there is some drawback it like
Difficult Interview Questions Page -1
drawback or fault in the company's  planning or strategy or functioning, you can
VoIP Devices
and function in much the same way. The main drawback associated with USB VoIP
sequence numbers without any overhead of locking. Drawback is that after generating