drawback of arralist - java

drawback of arralist - java

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 {
                       connection.close();
                   }catch(Exception e) {

                        try {
                              connection.close();

                         }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
java  What is the drawback when we use the multiple inheritance
CORE JAVA
. But to the performance point of view ArraList is better than the Vector because ArrayList
Advertisements
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. ADS_TO_REPLACE_1 IDSL has one drawback
PHP MySQLi
the connection.  One of the major drawback of persistent connection
database
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
then? Because APT has one major drawback: you need to convert from one format
What is POP?
that saves the money of the consumer or company.  POP has one drawback that 
Tattoo Removal Cream
, do not want the tattoo on your body. The other drawback of using tattoo
java
write business as well as presentation logic is Servlet. But there is a drawback
Why Open Source?
the conventional closed model. The drawback of the closed model is evident- its source
Why WiFi?
The small range is the biggest drawback for WiFi. Even while you can move about
Rich Internet Application
to reload the data is the biggest drawback of this system because all interactions
Rich Internet Application
that is required to reload the data is the biggest drawback of this system because all
Dog gps tracking chip
drawback in using GPS too, it requires connectivity, so if a dog is lost
Using Splunk with Hadoop
it. Later on data can be moved to Hadoop environment. One drawback is that Splunk
Hosted E-Commerce Solution
templates to choose from. The drawback of hosted solution is that it does
How jQuery works?
on page load. There is one drawback with this function. It does not fires
Apple's New iPad? Is It The Hottest New Release Or Simply An iFlop?
. Another drawback for the iPad is the battery life. It’s all good and well
Want To Know What You Can Do Expect From Your New iPad? Look No Further?
almost unnoticeable. The only reported drawback of the screen is that it may
Essentials You Need To Know About Apple's iPad
possible drawback of the screen that has been reported is that it may be too
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
ones. The only drawback is that the GPS tracker needs a coverage plan requiring
How would you honestly evaluate the strengths and weaknesses of your previous/current company/boss/team?
in on some serious drawback in your background and he brings it up. This could... solve these, you can prevent the drawback question from happening. 19. How
Top 10 Smartphones under INR 20,000
coupled with legendary Sony support, but the only drawback that comes to mind.... The only drawback of this phone is its paltry internal storage which is just
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
. If there was any drawback or fault in the company's  planning or strategy
VoIP Devices
and function in much the same way. The main drawback associated with USB VoIP
SQL
for generating sequence numbers without any overhead of locking. Drawback
Top 10 Tips for Good Website Design
the experts. There is one drawback to consider as well, that is to say in providing good
If you came on board with us, what changes would you make in the system?
serious drawback in your background. However in this case you are not totally missing
What would you rate as your greatest weaknesses?
that you do not really see any drawback in your background that might affect
Space based web-hosting system
hosting packages on their behalf. The only drawback that managed web hosting
Getting Around Agra
a car for the day has its own advantages and drawbacks. The major drawback

Ads