Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Interview-Questions maximum size of arraylist - java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


lokendra yadav
maximum size of arraylist - java
1 Answer(s)      2 years and 10 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?


Advertisement
View Answers

February 2, 2012 at 12:53 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:
What?s the maximum size of a row in SQL table?
What?s the maximum size of a row in SQL table?  What?s the maximum size of a row in SQL table?   Hi, The maximum Row Size is 8060 Bytes in a sql table. Thanks
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
Advertisements
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
How to find maximum value in ArrayList
How to find maximum value in ArrayList  **Sir i am writing below code but its not working.i don't know how to implement logic my requirement.My requirement is find maximum value in userdefined objects and dispaly that object
Getting the Maximum Size of a Preference Key and Value
Getting the Maximum Size of a Preference Key and Value       This section demonstrates you to get the maximum size of Preference key and value. You can see in the given example that we have
How to find maximum value for userdefined objects in ArrayList
How to find maximum value for userdefined objects in ArrayList  Hi sir,I have requirement i.e finding maximum value in userdefined objects... for employe class and write for below sample code ,in this code i can findout maximum
How to find maximum value for userdefined objects in ArrayList
How to find maximum value for userdefined objects in ArrayList  Hi sir,I have requirement i.e finding maximum value in userdefined objects... for employe class and write for below sample code ,in this code i can findout maximum
How to find maximum value for userdefined objects in ArrayList
How to find maximum value for userdefined objects in ArrayList  Hi sir,I have requirement i.e finding maximum value in userdefined objects... for employe class and write for below sample code ,in this code i can findout maximum
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
What is the maximum size of a file that can be uploaded using PHP and how can we change this?  What is the maximum size of a file that can be uploaded using PHP and how can we change
ArrayList
ArrayList  import java.util.*; class ArrayListDemo2 { public static void main(String args[]) { ArrayList al=new ArrayList(); al.add("one"); al.add("two"); al.add("three"); al.add("four"); for(int i=0;i Expected
arraylist
arraylist  Hi How can we eliminet duplicate element from arraylist? How can we find highest salary from arraylist ? How can we highest key value pair from map? Thanks Kalins Naik   Remove duplicates from Arraylist
arraylist
arraylist  Hi i have class A , i have added employee name and id in arraylist, then how can i find out all infomation of class A using emplyee... data into an arraylist and display the data of the particular employee according
arraylist
% *(noOfYearService/2). Store each employee information in different arrayList depending on his
arraylist of an arraylist
arraylist of an arraylist  Can anyone suggest me how to use arraylist of an arraylist?? how to put data into it and get data from it???? becoz i want to make rows and column dynamic which can grow as per requirement?????/ plz
Servletoutputstream size limit.
Servletoutputstream size limit.  What is the maximum size of ServletOutputStream
Servletoutputstream size limit.
Servletoutputstream size limit.  What is the maximum size of ServletOutputStream?   By default size is set to 10MB.You can increase your message size maximum 2000000000 bytes. That is size limit is 2000000000
Size of commarea
Size of commarea  hii, What is the size of commarea?   hello, Default size of commarea is 65k
arraylist and vector
arraylist and vector  what is the diff b/w arraylist and vector
ArrayList and Vector
ArrayList and Vector  hello, Why ArrayList is faster than Vector?   hii, ArrayList is faster than Vector, because ArrayList is not synchronized. Synchronization will reduce the performance of Vector
Size in FLex
Size in FLex  Hi..... What is the difference between width, explicitWidth, measuredMinWidth, measuredWidth, and percentWidth? please tell me about that difference Thanks
Size in FLex
Size in FLex  Hi... I just want to know about... What happens in measure()? measuredHeight, measuredWidth, measuredMinHeight, measuredMinWidth are set. please give me an example with description... Thanks
maximum open cursors exceeded - JMS
maximum open cursors exceeded  Hi, i m getting error java.sql.SQLException: ORA-01000: maximum open cursors exceeded in java.could u tell me why???? Thanks Narendra
ArrayList object
ArrayList object  i have am ArrayList object it containg data base records in it, now i want to display this ArrayList object data in my jsp programe, plz help me
Table maximum Row count - JDBC
Table maximum Row count  Dear friends I want to select maximum... 5 7 5 3 4 5 2 5 1 my output will be 5 means 5 is maximum time... maximum time entry value? Thanks in advance Rajkumar  Hi friend
ArrayList elements
ArrayList elements  how to print ArrayList elements in reverse order... ArrayListReverse { public static void main(String[] args) { ArrayList list=new ArrayList(); list.add("Innova"); list.add("Alto
Maximum number of catches for a try block
Maximum number of catches for a try block  How many catch statements are allowed for a try statement?   Hello Friend, You can use any number of catch statement for a try statement. Thanks
Exceeeded maximum number of redirects: 5
Exceeeded maximum number of redirects: 5  Hi, I am testing on a project ( HTML + Flex ) using jmeter and getting this error in between: java.io.IOException: Exceeeded maximum number of redirects: 5
Exceeeded maximum number of redirects: 5
Exceeeded maximum number of redirects: 5  Hi, I am testing on a project ( HTML + Flex ) using jmeter and getting this error in between: java.io.IOException: Exceeeded maximum number of redirects: 5
comparing arraylist of an multi dimensional arraylist
comparing arraylist of an multi dimensional arraylist  can anyone help me in solving the following issue: actually i have an arraylist called dany... have to compare each arraylist with each other. like i have to take 1st arraylist
Maximum length of Session ( $_SESSION ) in PHP.
Maximum length of Session ( $_SESSION ) in PHP.  sir, i want to know that how much limit of storing data into session in php. i mean can i store full product descriptions into session. Thank u
 

 

 

DMCA.com