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?
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:
How to find maximum value in ArrayListHow 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 ArrayListHow 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 ArrayListHow 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 ArrayListHow 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
ArrayListArrayList 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
arraylistarraylist 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 arraylistarraylist 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 arraylistarraylist 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?
By default
size is set to 10MB.You can increase
your message
size maximum 2000000000 bytes.
That is
size limit is 2000000000
ArrayList and VectorArrayList and Vector hello,
Why
ArrayList is faster than Vector?
hii,ADS_TO_REPLACE_1
ArrayList is faster than Vector, because
ArrayList is not synchronized. Synchronization will reduce the performance of Vector
Size of commareaSize of commarea hii,
What is the
size of commarea?
hello,ADS_TO_REPLACE_1
Default
size of commarea is 65k
Collection : ArrayList Example of
ArrayList : " +
size);
// Adding elements in
ArrayList
list.add(333...();
System.out.println("
Size of
ArrayList after adding elements : " +
size);
System.out.println("Elements of
ArrayList : ");
for (int i = 0; i <
size ArrayList objectArrayList 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
ArrayList elementsArrayList 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
comparing arraylist of an multi dimensional arraylistcomparing
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 Size in FLexSize in FLex Hi.....
What is the difference between width, explicitWidth, measuredMinWidth, measuredWidth, and percentWidth?
please tell me about that difference
Thanks
Size in FLexSize 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
vector and arraylist vector and
arraylist suppose
i have class A {
public static arrylist a1(){}
class B{
public static vector b1()
{}
}
my question is how to class B method in Class A and how to get vector object values in class A without
arraylist problems?arraylist problems? myprogram needs to ask the user for a file name. The file will contain a name on each line. Put each of the names into an
ArrayList.
After you have put all of the names into the
ArrayList search through
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
arraylistarraylist Hi
how can we eliminet duplicate element from
arraylist in
java?
how can we achieve data abstrcation and encapulation in
java?
how many type of modifier are there in
java?
Thanks
kalins anik
Remove
arraylist arraylist Using
arraylist class , what type of exception are throws, how can write a
java programe
An
ArrayList can throw... ArraylistException {
void buildAlphabet() {
ArrayList list = new
ArrayList Table maximum Row count - JDBCTable
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
Maximum number of catches for a try blockMaximum 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: 5Exceeeded
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: 5Exceeeded
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
To insert maximum number of data in database.To insert
maximum number of data in database. how to change string data type into clob data type in jsp
Hi Friend,
Please visit the following link:ADS_TO_REPLACE_1
http://www.roseindia.net/jdbc/insert-clob
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
JSP List Size
JSP List
Size
JSP List
Size is used to get the
size of the list. The JSP List
Size uses
array list object to add the elements and finally
Remove multiple elements in arraylist Remove multiple elements in
arraylist how can we remove multiple values in
arrayList?
only remove method we used for single remove.but i want to delete multiple value in
arrayList How to Convert ArrayList to Array?How to Convert
ArrayList to Array? Hi,
I am trying to learn to Convert
ArrayList to Array.
How it is possible?
How to Convert
ArrayList to Array?
Thanks
Hi,
To Convert
ArrayList to array ArrayList.toArray
Fixed size tablesFixed
size tables Can anyone help me in creating a fixed
size table in mysql database
Printing ArrayList - JSP-ServletPrinting ArrayList I have a code in servlet like this
ArrayList total = new
ArrayList ();
session.setAttribute("efg",total...(request,response);
to print the values in
ArrayList total, I did this in my JSP
How to show the maximum and the minimum in array...How to show the
maximum and the minimum in array... I have a bookstore application, but I cannot show the
maximum and the minimum price of the book. Please see my codes below.
import java.util.*;
public class Book{
public